The equals and hashCode methods of this interace are used instead of the methods of the compared Objects.
The DefaultComparator implmentation calls the Object's methods.
The IdentityComparator implementation uses == instead of the equals
method of the Object.
Updated for generics fredt@users.
| Modifier and Type | Class and Description |
|---|---|
| public static class | ObjectComparator.
Comparator that uses the equals and hash code methods of Objects. |
| public static class |
| Modifier and Type | Field and Description |
|---|---|
| public static final ObjectComparator | |
| public static final ObjectComparator |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | |
| public int | |
| public long |
| defaultComparator | back to summary |
|---|---|
| public static final ObjectComparator<T> defaultComparator | |
| identityComparator | back to summary |
|---|---|
| public static final ObjectComparator<T> identityComparator | |
| equals | back to summary |
|---|---|
| public boolean equals(T a, T b) | |
| hashCode | back to summary |
|---|---|
| public int hashCode(T a) | |
| longKey | back to summary |
|---|---|
| public long longKey(T a) | |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | |
| public int | |
| public long |
| DefaultComparator | back to summary |
|---|---|
| public DefaultComparator() | |
| equals | back to summary |
|---|---|
| public boolean equals(T a, T b) Implements org. | |
| hashCode | back to summary |
|---|---|
| public int hashCode(T a) Implements org. | |
| longKey | back to summary |
|---|---|
| public long longKey(T a) Implements org. | |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | |
| public int | |
| public long |
| IdentityComparator | back to summary |
|---|---|
| public IdentityComparator() | |
| equals | back to summary |
|---|---|
| public boolean equals(T a, T b) Implements org. | |
| hashCode | back to summary |
|---|---|
| public int hashCode(T a) Implements org. | |
| longKey | back to summary |
|---|---|
| public long longKey(T a) Implements org. | |