예제 #1
0
  @Override
  public boolean equals(Object o) {
    if (o == null) return false;
    if (!(o instanceof ERTriple)) {
      return false;
    }
    ERTriple p = (ERTriple) o;

    return hashkey.equals(p.toString());
  }
예제 #2
0
 @Override
 /**
  * this = <a,b> o = <c,d>
  *
  * <p>if (compare(a,c)==0) then compare(b,d) else compare(a,c)
  */
 public int compareTo(ERTriple o) {
   if (o == null) return 1;
   int comp_first = this.getSource().compareTo(o.getSource());
   if (comp_first == 0) {
     comp_first = this.getRelation().compareTo(o.getRelation());
     if (comp_first == 0) {
       return this.getDestination().compareTo(o.getDestination());
     }
   }
   return comp_first;
 }