org.springframework.util.comparator
Class BooleanComparator
java.lang.Object
   org.springframework.util.comparator.BooleanComparator
org.springframework.util.comparator.BooleanComparator
- All Implemented Interfaces: 
- Serializable, Comparator
- public final class BooleanComparator 
- extends Object- implements Comparator, Serializable
A Comparator for Boolean objects that can sort either true or false first.
- Since:
- 1.2.2
- Author:
- Keith Donald
- See Also:
- Serialized Form
 
| Constructor Summary | 
| BooleanComparator(boolean trueLow)Create a BooleanComparator that sorts boolean values based on
 the provided flag.
 | 
 
 
 
TRUE_LOW
public static final BooleanComparator TRUE_LOW
- A shared default instance of this comparator, treating true lower
 than false.
 
 
TRUE_HIGH
public static final BooleanComparator TRUE_HIGH
- A shared default instance of this comparator, treating true higher
 than false.
 
 
BooleanComparator
public BooleanComparator(boolean trueLow)
- Create a BooleanComparator that sorts boolean values based on
 the provided flag.
 Alternatively, you can use the default shared instances:
 BooleanComparator.TRUE_LOWandBooleanComparator.TRUE_HIGH.
 
 
- Parameters:
- trueLow- whether to treat true as lower or higher than false
- See Also:
- TRUE_LOW,- TRUE_HIGH
 
compare
public int compare(Object o1,
                   Object o2)
- 
- Specified by:
- comparein interface- Comparator
 
- 
 
equals
public boolean equals(Object obj)
- 
- Specified by:
- equalsin interface- Comparator
- Overrides:
- equalsin class- Object
 
- 
 
hashCode
public int hashCode()
- 
- Overrides:
- hashCodein class- Object
 
- 
 
toString
public String toString()
- 
- Overrides:
- toStringin class- Object
 
- 
 
Copyright © 2002-2008 The Spring Framework.