public Set<String> joinFields(String fldName){
  Set<String> flds=new HashSet<String>();
  flds.add(fldName);
  Deque<String> queue=new LinkedList<String>();
  queue.addLast(fldName);
  while (!queue.isEmpty()) {
    String fld=queue.removeFirst();
    for (    Term t : terms) {
      String s=t.oppositeField(fld);
      if (s != null && t.operator(fldName) == OP_EQ && !flds.contains(s)) {
        flds.add(s);
        queue.addLast(s);
      }
    }
  }
  flds.remove(fldName);
  return flds.size() == 0 ? null : flds;
}

public Set < String > joinFields ( String fldName ) { Set < String > flds = new HashSet < String > ( ) ; flds . add ( fldName ) ; Deque < String > queue = new LinkedList < String > ( ) ; queue . addLast ( fldName ) ; while ( ! queue . isEmpty ( ) ) { String fld = queue . removeFirst ( ) ; for ( Term t : terms ) { String s = t . oppositeField ( fld ) ; if ( s != null && t . operator ( fldName ) == OP_EQ && ! flds . contains ( s ) ) { flds . add ( s ) ; queue . addLast ( s ) ; } } } flds . remove ( fldName ) ; return flds . size ( ) == 0 ? null : flds ; }
determines if there are terms of the form " f1 = f2 " or result in " f1 = f2 " via equal transitivity , where f1 is the specified field and f2 is another field ( called join field ) . if so , the method returns the names of all join fields . if not , the method returns null .
