public int compareTo(NameImpl obj){
  if (this == obj) {
    return 0;
  }
  int len1=size();
  int len2=obj.size();
  int n=Math.min(len1,len2);
  int index1=0, index2=0;
  while (n-- != 0) {
    String comp1=get(index1++);
    String comp2=obj.get(index2++);
    if (syntaxTrimBlanks) {
      comp1=comp1.trim();
      comp2=comp2.trim();
    }
    int local;
    if (syntaxCaseInsensitive) {
      local=comp1.compareToIgnoreCase(comp2);
    }
 else {
      local=comp1.compareTo(comp2);
    }
    if (local != 0) {
      return local;
    }
  }
  return len1 - len2;
}

public int compareTo ( NameImpl obj ) { if ( this == obj ) { return 0 ; } int len1 = size ( ) ; int len2 = obj . size ( ) ; int n = Math . min ( len1 , len2 ) ; int index1 = 0 , index2 = 0 ; while ( n -- != 0 ) { String comp1 = get ( index1 ++ ) ; String comp2 = obj . get ( index2 ++ ) ; if ( syntaxTrimBlanks ) { comp1 = comp1 . trim ( ) ; comp2 = comp2 . trim ( ) ; } int local ; if ( syntaxCaseInsensitive ) { local = comp1 . compareToIgnoreCase ( comp2 ) ; } else { local = comp1 . compareTo ( comp2 ) ; } if ( local != 0 ) { return local ; } } return len1 - len2 ; }
compares obj to this nameimpl to determine ordering . takes into account syntactic properties such as elimination of blanks , case - ignore , etc , if relevant . note : using syntax of this nameimpl and ignoring that of comparison target .
