package netmatch.algorithm;

import java.util.ArrayList;

public class approxNodeComparator implements AttrComparator {
  public approxNodeComparator() {
  }

  public boolean compatible(Object p1, Object p2) throws Exception {
    ArrayList t;
    String q;

    if(p1 instanceof ArrayList) {
      t = (ArrayList)p1;
      q = (String)p2;
    }
    else {
      t = (ArrayList)p2;
      q = (String)p1;
    }
    if(((String)t.get(0)).endsWith(Common.SELF_EDGE) == q.endsWith(Common.SELF_EDGE)) {
      return true;
    }
    return false;

    /*String pa = (String)p1;
    String pb = (String)p2;
    if((pa.endsWith(Common.SELF_EDGE) && !pb.endsWith(Common.SELF_EDGE)) || (!pa.endsWith(Common.SELF_EDGE) && pb.endsWith(Common.SELF_EDGE)))
      return false;
    return true;*/

  }
}