This class is an abstract implementation defining the basic API. It refers to the elements as 'left', 'middle' and 'right'.
Subclass implementations may be mutable or immutable. However, there is no restriction on the type of the stored objects that may be stored. If mutable objects are stored in the triple, then the triple itself effectively becomes mutable.
| Modifier and Type | Field and Description |
|---|---|
| public static final Triple | EMPTY_ARRAY
An empty array. |
| private static final long | serialVersionUID
Serialization version |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public int | Returns: negative if this is less, zero if equal, positive if greater.the other triple, not null. other)Implements java. Compares the triple based on the left element, followed by the middle element, finally the right element. |
| public static < the left element type. L, the middle element type. M, the right element type. R> Triple | Returns: the empty array singleton that can be assigned without compiler warning.Returns the empty array singleton that can be assigned without compiler warning. |
| public boolean | Returns: true if the elements of the triple are equal.the object to compare to, null returns false. obj)Overrides java. Compares this triple to another based on the three elements. |
| public abstract L | |
| public abstract M | |
| public abstract R | |
| public int | |
| public static < the left element type. L, the middle element type. M, the right element type. R> Triple | Returns: an immutable triple formed from the three parameters, not null.the left element, may be null. left, final M the middle element, may be null. middle, final R the right element, may be null. right)Obtains an immutable triple of three objects inferring the generic types. |
| public static < the left element type. L, the middle element type. M, the right element type. R> Triple | Returns: an immutable triple formed from the three parameters, not null.the left element, may not be null. left, final M the middle element, may not be null. middle, final R the right element, may not be null. right)Obtains an immutable triple of three non-null objects inferring the generic types. |
| public String | Returns: a string describing this object, not null.Overrides java. Returns a String representation of this triple using the format |
| public String |
| EMPTY_ARRAY | back to summary |
|---|---|
| public static final Triple<?, ?, ?>[] EMPTY_ARRAY An empty array.
Consider using
| |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID Serialization version | |
| Triple | back to summary |
|---|---|
| public Triple() Constructs a new instance. | |
| compareTo | back to summary |
|---|---|
| public int compareTo(final Triple<L, M, R> other) Implements java. Compares the triple based on the left element, followed by the middle element,
finally the right element.
The types must be | |
| emptyArray | back to summary |
|---|---|
| public static <L, M, R> Triple Returns the empty array singleton that can be assigned without compiler warning.
| |
| equals | back to summary |
|---|---|
| public boolean equals(final Object obj) Overrides java. Compares this triple to another based on the three elements. | |
| getLeft | back to summary |
|---|---|
| public abstract L getLeft() Gets the left element from this triple.
| |
| getMiddle | back to summary |
|---|---|
| public abstract M getMiddle() Gets the middle element from this triple.
| |
| getRight | back to summary |
|---|---|
| public abstract R getRight() Gets the right element from this triple.
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Returns a suitable hash code.
The hash code is adapted from the definition in
| |
| of | back to summary |
|---|---|
| public static <L, M, R> Triple Obtains an immutable triple of three objects inferring the generic types.
| |
| ofNonNull | back to summary |
|---|---|
| public static <L, M, R> Triple Obtains an immutable triple of three non-null objects inferring the generic types.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Returns a String representation of this triple using the format | |
| toString | back to summary |
|---|---|
| public String toString(final String format) Formats the receiver using the given format. This uses | |