/* * (non-Javadoc) * * @see java.util.AbstractSet#equals(java.lang.Object) */ @Override public boolean equals(Object o) { if (o instanceof GraphCycle) { GraphCycle gc = (GraphCycle) o; if (gc.size() != size()) return false; for (int i = 0; i < size(); i++) { GraphNode n1 = (GraphNode) toArray()[i]; GraphNode n2 = (GraphNode) gc.toArray()[i]; if (!n1.equals(n2)) return false; } return true; } return false; }
/* * (non-Javadoc) * * @see java.lang.Comparable#compareTo(java.lang.Object) */ @Override public int compareTo(GraphCycle o) { return o.size() - size(); }