@SuppressWarnings("unchecked") public boolean equalsIgnoreCase(ForeignKey otherFk){
  boolean checkName=isCheckName(otherFk);
  if ((!checkName || name.equalsIgnoreCase(otherFk.name)) && foreignTableName.equalsIgnoreCase(otherFk.foreignTableName)) {
    HashSet<Reference> otherRefs=new HashSet<Reference>();
    otherRefs.addAll(otherFk.references);
    for (Iterator<?> it=references.iterator(); it.hasNext(); ) {
      Reference curLocalRef=(Reference)it.next();
      boolean found=false;
      for (Iterator<?> otherIt=otherRefs.iterator(); otherIt.hasNext(); ) {
        Reference curOtherRef=(Reference)otherIt.next();
        if (curLocalRef.equalsIgnoreCase(curOtherRef)) {
          otherIt.remove();
          found=true;
          break;
        }
      }
      if (!found) {
        return false;
      }
    }
    return otherRefs.isEmpty();
  }
 else {
    return false;
  }
}

@ SuppressWarnings ( "unchecked" ) public boolean equalsIgnoreCase ( ForeignKey otherFk ) { boolean checkName = isCheckName ( otherFk ) ; if ( ( ! checkName || name . equalsIgnoreCase ( otherFk . name ) ) && foreignTableName . equalsIgnoreCase ( otherFk . foreignTableName ) ) { HashSet < Reference > otherRefs = new HashSet < Reference > ( ) ; otherRefs . addAll ( otherFk . references ) ; for ( Iterator < ? > it = references . iterator ( ) ; it . hasNext ( ) ; ) { Reference curLocalRef = ( Reference ) it . next ( ) ; boolean found = false ; for ( Iterator < ? > otherIt = otherRefs . iterator ( ) ; otherIt . hasNext ( ) ; ) { Reference curOtherRef = ( Reference ) otherIt . next ( ) ; if ( curLocalRef . equalsIgnoreCase ( curOtherRef ) ) { otherIt . remove ( ) ; found = true ; break ; } } if ( ! found ) { return false ; } } return otherRefs . isEmpty ( ) ; } else { return false ; } }
compares this foreign key to the given one while ignoring the case of identifiers .
