| Modifier and Type | Field and Description |
|---|---|
| public static final BooleanComparator | TRUE_HIGH
A shared default instance of this comparator,
treating |
| public static final BooleanComparator | TRUE_LOW
A shared default instance of this comparator,
treating |
| private final boolean |
| Access | Constructor and Description |
|---|---|
| public | BooleanComparator(boolean
whether to treat true as lower or higher than false trueLow)Create a BooleanComparator that sorts boolean values based on the provided flag. |
| Modifier and Type | Method and Description |
|---|---|
| public int | compare(Boolean
the first object to be compared. left, Boolean the second object to be compared. right)Implements java. Compares its two arguments for order. |
| public boolean | equals(Object
the reference object with which to compare. other)Overrides java. Implements java. Indicates whether some other object is "equal to" this comparator. |
| public int | |
| public String |
| TRUE_HIGH | back to summary |
|---|---|
| public static final BooleanComparator TRUE_HIGH A shared default instance of this comparator,
treating | |
| TRUE_LOW | back to summary |
|---|---|
| public static final BooleanComparator TRUE_LOW A shared default instance of this comparator,
treating | |
| trueLow | back to summary |
|---|---|
| private final boolean trueLow | |
| BooleanComparator | back to summary |
|---|---|
| public BooleanComparator(boolean trueLow) Create a BooleanComparator that sorts boolean values based on the provided flag. Alternatively, you can use the default shared instances:
| |
| compare | back to summary |
|---|---|
| public int compare(Boolean left, Boolean right) Implements java. Doc from java. Compares its two arguments for order. Returns a negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater than the second.
The implementor must ensure that
The implementor must also ensure that the relation is transitive:
Finally, the implementor must ensure that | |
| equals | back to summary |
|---|---|
| public boolean equals(Object other) Overrides java. Implements java. Doc from java. Indicates whether some other object is "equal to"
this comparator. This method must obey the general contract of
Note that it is always safe not to override
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Doc from java. Returns a hash code value for this object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non- | |