@NotNull List<DfaValue> getEquivalentValues(@NotNull DfaValue dfaValue) { int index = getEqClassIndex(dfaValue); EqClass set = index == -1 ? null : myEqClasses.get(index); if (set == null) { return Collections.emptyList(); } return set.getMemberValues(); }
@SuppressWarnings("HardCodedStringLiteral") public String toString() { StringBuilder result = new StringBuilder(); result.append('<'); if (myEphemeral) { result.append("ephemeral, "); } for (EqClass set : getNonTrivialEqClasses()) { result.append(set); } if (!myDistinctClasses.isEmpty()) { result.append("\n distincts: "); List<String> distincts = new ArrayList<>(); for (UnorderedPair<EqClass> pair : getDistinctClassPairs()) { distincts.add("{" + pair.first + ", " + pair.second + "}"); } Collections.sort(distincts); result.append(StringUtil.join(distincts, " ")); } if (!myStack.isEmpty()) { result.append("\n stack: ").append(StringUtil.join(myStack, ",")); } if (!myVariableStates.isEmpty()) { result.append("\n vars: "); for (Map.Entry<DfaVariableValue, DfaVariableState> entry : myVariableStates.entrySet()) { result .append("[") .append(entry.getKey()) .append("->") .append(entry.getValue()) .append("] "); } } if (!myUnknownVariables.isEmpty()) { result.append("\n unknowns: ").append(new HashSet<>(myUnknownVariables)); } result.append('>'); return result.toString(); }