public String toString(String token) { StringBuilder b = new StringBuilder(); b.append("("); for (int i = 0; i < size(); i++) { if (i > 0) b.append(" ").append(token).append(" "); b.append(get(i)); } b.append(")"); return b.toString(); }
@Override public boolean equals(Object other) { if (this == other) return true; if (other == null || !getClass().isInstance(other)) return false; MultiCondition oth = (MultiCondition)other; if (getType() != oth.getType() || size() != oth.size()) return false; for (int i = 0; i < size(); i++) { boolean foundEqual = false; for (int j = 0; j < oth.size(); j++) { if (get(i).equals(oth.get((i + j) % oth.size()))) { foundEqual = true; break; } } if (!foundEqual) return false; } return true; }
@Override public boolean equals(Object other) { if (this == other) return true; if (other == null || !getClass().isInstance(other)) return false; MultiCondition oth = (MultiCondition)other; if (getType() != oth.getType() || size() != oth.size()) return false; for (int i = 0; i < size(); i++) { boolean foundEqual = false; for (int j = 0; j < oth.size(); j++) { if (get(i).equals(oth.get((i + j) % oth.size()))) { foundEqual = true; break; } } if (!foundEqual) return false; } return true; }
public String toString(String token) { StringBuilder b = new StringBuilder(); b.append("("); for (int i = 0; i < size(); i++) { if (i > 0) b.append(" ").append(token).append(" "); b.append(get(i)); } b.append(")"); return b.toString(); }
@Override public boolean equals(Object other) { if (this == other) return true; if (other == null || !getClass().isInstance(other)) return false; MultiCondition oth = (MultiCondition)other; if (getType() != oth.getType() || size() != oth.size()) return false; for (int i = 0; i < size(); i++) { boolean foundEqual = false; for (int j = 0; j < oth.size(); j++) { if (get(i).equals(oth.get((i + j) % oth.size()))) { foundEqual = true; break; } } if (!foundEqual) return false; } return true; }
public String toString(String token) { StringBuilder b = new StringBuilder(); b.append("("); for (int i = 0; i < size(); i++) { if (i > 0) b.append(" ").append(token).append(" "); b.append(get(i)); } b.append(")"); return b.toString(); }