Package org.jgrapht.alg.util
Class Triple<A,B,C>
- 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:
Serializable
public class Triple<A,B,C> extends Object implements Serializable
Generic triple (3-tuple).- Author:
- Dimitrios Michail
- See Also:
- Serialized Form
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)AgetFirst()Get the first elementBgetSecond()Get the second elementCgetThird()Get the third element<E> booleanhasElement(E e)Assess if this triple contains an element.inthashCode()static <A,B,C>
Triple<A,B,C>of(A a, B b, C c)Create a new triple.voidsetFirst(A a)Set the first elementvoidsetSecond(B b)Set the second elementvoidsetThird(C c)Set the third elementStringtoString()
-
-
-
Method Detail
-
getFirst
public A getFirst()
Get the first element- Returns:
- the first element
-
getSecond
public B getSecond()
Get the second element- Returns:
- the second element
-
getThird
public C getThird()
Get the third element- Returns:
- the third element
-
setFirst
public void setFirst(A a)
Set the first element- Parameters:
a- the element to be assigned
-
setSecond
public void setSecond(B b)
Set the second element- Parameters:
b- the element to be assigned
-
setThird
public void setThird(C c)
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
-
of
public static <A,B,C> Triple<A,B,C> of(A a, B b, C c)
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
-
-