com.imagero.gui.swing.tree.util
Class FileNodeComparator

java.lang.Object
  extended bycom.imagero.gui.swing.tree.util.DMNodeComparator
      extended bycom.imagero.gui.swing.tree.util.FileNodeComparator
All Implemented Interfaces:
java.util.Comparator, TreeNodeComparator

public class FileNodeComparator
extends DMNodeComparator


Field Summary
 
Fields inherited from class com.imagero.gui.swing.tree.util.DMNodeComparator
directoriesFirst, UNDEFINED
 
Constructor Summary
FileNodeComparator()
           
 
Method Summary
 int compare(HTreeNode node1, HTreeNode node2)
           
 boolean equals(java.lang.Object o)
          Indicates whether some other object is "equal to" this Comparator.
 
Methods inherited from class com.imagero.gui.swing.tree.util.DMNodeComparator
checkDirectory, checkNull, compare, isDirectoriesFirst, setDirectoriesFirst
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileNodeComparator

public FileNodeComparator()
Method Detail

compare

public int compare(HTreeNode node1,
                   HTreeNode node2)
Specified by:
compare in interface TreeNodeComparator
Overrides:
compare in class DMNodeComparator
Parameters:
node1 - first node
node2 - second node
Returns:
UNDEFINED if compare result is unknown

equals

public boolean equals(java.lang.Object o)
Description copied from interface: java.util.Comparator
Indicates whether some other object is "equal to" this Comparator. This method must obey the general contract of Object.equals(Object). Additionally, this method can return true only if the specified Object is also a comparator and it imposes the same ordering as this comparator. Thus, comp1.equals(comp2) implies that sgn(comp1.compare(o1, o2))==sgn(comp2.compare(o1, o2)) for every object reference o1 and o2.

Note that it is always safe not to override Object.equals(Object). However, overriding this method may, in some cases, improve performance by allowing programs to determine that two distinct Comparators impose the same order.

Specified by:
equals in interface java.util.Comparator
Overrides:
equals in class DMNodeComparator