| Modifier and Type | Class and Description |
|---|---|
| private static record | MultiComparator.
The type of the object the predicate takes. T>A record that stores a predicate and its priority. |
| Modifier and Type | Field and Description |
|---|---|
| private final ArrayList |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public MultiComparator | addPredicate(Predicate<T>
The predicate to add. p, int The priority of the predicate. The higher the priority, the earlier the predicate will be
checked. priority)Adds a predicate to the list of predicates to be used when comparing. |
| public MultiComparator | addPredicate(Predicate<T>
The predicate to add. p)Adds a predicate to the list of predicates to be used when comparing. |
| public int | Returns: -1 if the first object is "greater" than the second, 1 if the second object is "greater" than the first, 0 if they are equal.The first object to compare. first, T The second object to compare. second)Compares the two objects given using the predicates added to this comparator. |
| predicates | back to summary |
|---|---|
| private final ArrayList<MultiComparator. | |
| MultiComparator | back to summary |
|---|---|
| public MultiComparator() | |
| addPredicate | back to summary |
|---|---|
| public MultiComparator Adds a predicate to the list of predicates to be used when comparing.
| |
| addPredicate | back to summary |
|---|---|
| public MultiComparator Adds a predicate to the list of predicates to be used when comparing. The priority of the predicate will be 0.
| |
| compare | back to summary |
|---|---|
| public int compare(T first, T second) Compares the two objects given using the predicates added to this comparator.
| |
| Modifier and Type | Field and Description |
|---|---|
| private final Predicate | predicateCb
Record Component accessed by predicateCb(). The predicate. |
| private final int | priority
Record Component accessed by priority(). The priority of the predicate. |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public final boolean | equals(Object o)
Implements abstract java. Indicates whether some other object is "equal to" this one. |
| public final int | |
| public Predicate | |
| public int | |
| public final String | toString()
Implements abstract java. Returns a string representation of the record. |
| predicateCb | back to summary |
|---|---|
| private final Predicate<T> predicateCb Record Component accessed by predicateCb(). The predicate. | |
| priority | back to summary |
|---|---|
| private final int priority Record Component accessed by priority(). The priority of the predicate. | |
| Pred | back to summary |
|---|---|
| pack-priv Pred(int priority, Predicate<T> predicateCb) | |
| equals | back to summary |
|---|---|
| public final boolean equals(Object o) Implements abstract java. Doc from java. Indicates whether some other object is "equal to" this one. In addition
to the general contract of
R copy = new R(r.c1(), r.c2(), ..., r.cn());
then it must be the case that r.equals(copy).
| |
| hashCode | back to summary |
|---|---|
| public final int hashCode() Implements abstract java. Doc from java. Returns a hash code value for the record.
Obeys the general contract of | |
| predicateCb | back to summary |
|---|---|
| public Predicate Record Component getter of predicateCb.
| |
| priority | back to summary |
|---|---|
| public int priority() Record Component getter of priority.
| |
| toString | back to summary |
|---|---|
| public final String toString() Implements abstract java. Doc from java. Returns a string representation of the record.
In accordance with the general contract of In addition to this general contract, record classes must further participate in the invariant that any two records which are equal must produce equal strings. This invariant is necessarily relaxed in the rare case where corresponding equal component values might fail to produce equal strings for themselves. | |