| Modifier and Type | Field and Description |
|---|---|
| private final Comparator | nonNullComparator
The comparator to use when comparing two non- |
| private final boolean | nullsAreHigh
Specifies whether a |
| private static final long | serialVersionUID
Serialization version. |
| Access | Constructor and Description |
|---|---|
| public | NullComparator()
Construct an instance that sorts |
| public | NullComparator(final Comparator<? super E>
the comparator to use when comparing two
non- nonNullComparator)null objects. This argument cannot be
nullConstruct an instance that sorts |
| public | NullComparator(final boolean
a nullsAreHigh)true value indicates that
null should be compared as higher than a
non-null object. A false value indicates
that null should be compared as lower than a
non-null object.Construct an instance that sorts |
| public | NullComparator(final Comparator<? super E>
the comparator to use when comparing two
non- nonNullComparator, final boolean null objects. This argument cannot be
nulla nullsAreHigh)true value indicates that
null should be compared as higher than a
non-null object. A false value indicates
that null should be compared as lower than a
non-null object.Construct an instance that sorts |
| Modifier and Type | Method and Description |
|---|---|
| public int | Returns: -1 if o1 is "lower" than (less than,
before, etc.) o2; 1 if o1 is
"higher" than (greater than, after, etc.) o2; or
0 if o1 and o2 are equal.the first object to compare o1, final E the object to compare it to. o2)Implements java. |
| public boolean | Returns: true if the specified object is a NullComparator
with equivalent null comparison behavior
(i.e. null high or low) and with equivalent underlying
non-null object comparators.the object to compare this comparator with. obj)Overrides java. Implements java. |
| public int | Returns: a hash code for this comparator.Overrides java. equals(Object).
|
| nonNullComparator | back to summary |
|---|---|
| private final Comparator<? super E> nonNullComparator The comparator to use when comparing two non- | |
| nullsAreHigh | back to summary |
|---|---|
| private final boolean nullsAreHigh Specifies whether a | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID Serialization version. | |
| NullComparator | back to summary |
|---|---|
| public NullComparator() Construct an instance that sorts | |
| NullComparator | back to summary |
|---|---|
| public NullComparator(final Comparator<? super E> nonNullComparator) Construct an instance that sorts
| |
| NullComparator | back to summary |
|---|---|
| public NullComparator(final boolean nullsAreHigh) Construct an instance that sorts
| |
| NullComparator | back to summary |
|---|---|
| public NullComparator(final Comparator<? super E> nonNullComparator, final boolean nullsAreHigh) Construct an instance that sorts
| |
| compare | back to summary |
|---|---|
| public int compare(final E o1, final E o2) Implements java. Perform a comparison between two objects. If both objects are
| |
| equals | back to summary |
|---|---|
| public boolean equals(final Object obj) Overrides java. Implements java. Determines whether the specified object represents a comparator that is equal to this comparator. | |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Implement a hash code for this comparator that is consistent with
| |