Exemple #1
0
 /*
  * (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;
 }
Exemple #2
0
 /*
  * (non-Javadoc)
  *
  * @see java.lang.Comparable#compareTo(java.lang.Object)
  */
 @Override
 public int compareTo(GraphCycle o) {
   return o.size() - size();
 }