FileDocCategorySizeDatePackage
TreeStringComparator.javaAPI DocExample690Thu Oct 24 20:14:26 BST 2002None

TreeStringComparator

public class TreeStringComparator extends Object implements Comparator

Fields Summary
Constructors Summary
Methods Summary
public intcompare(java.lang.Object o1, java.lang.Object o2)

    if (!(o1 instanceof DefaultMutableTreeNode && 
          o2 instanceof DefaultMutableTreeNode)) {
      throw new IllegalArgumentException("Can only compare DefaultMutableTreeNode objects");
    }
    String s1 = ((DefaultMutableTreeNode)o1).getUserObject().toString();
    String s2 = ((DefaultMutableTreeNode)o2).getUserObject().toString();
    return s1.compareToIgnoreCase(s2);