java.lang.Object
org.jgrapht.alg.util.Triple<A,B,C>
- Type Parameters:
A
- the first element typeB
- the second element typeC
- the third element type
- All Implemented Interfaces:
java.io.Serializable
public class Triple<A,B,C>
extends java.lang.Object
implements java.io.Serializable
Generic triple (3-tuple).
- Author:
- Dimitrios Michail
- See Also:
- Serialized Form
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and Type Method Description boolean
equals(java.lang.Object o)
A
getFirst()
Get the first elementB
getSecond()
Get the second elementC
getThird()
Get the third element<E> boolean
hasElement(E e)
Assess if this triple contains an element.int
hashCode()
static <A, B, C> Triple<A,B,C>
of(A a, B b, C c)
Create a new triple.void
setFirst(A a)
Set the first elementvoid
setSecond(B b)
Set the second elementvoid
setThird(C c)
Set the third elementjava.lang.String
toString()
-
Field Details
-
Constructor Details
-
Triple
Create a new triple- Parameters:
a
- the first elementb
- the second elementc
- the third element
-
-
Method Details
-
getFirst
Get the first element- Returns:
- the first element
-
getSecond
Get the second element- Returns:
- the second element
-
getThird
Get the third element- Returns:
- the third element
-
setFirst
Set the first element- Parameters:
a
- the element to be assigned
-
setSecond
Set the second element- Parameters:
b
- the element to be assigned
-
setThird
Set the third element- Parameters:
c
- the element to be assigned
-
hasElement
public <E> boolean hasElement(E e)Assess if this triple contains an element.- Type Parameters:
E
- the element type- Parameters:
e
- The element in question- Returns:
- true if contains the element, false otherwise
-
toString
public java.lang.String toString()- Overrides:
toString
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()- Overrides:
hashCode
in classjava.lang.Object
-
of
Create a new triple.- Type Parameters:
A
- the first element typeB
- the second element typeC
- the third element type- Parameters:
a
- first elementb
- second elementc
- third element- Returns:
- new triple
-