Package org.tribuo.util.infotheory.impl
Class CachedTriple<T1,T2,T3>
java.lang.Object
org.tribuo.util.infotheory.impl.CachedTriple<T1,T2,T3>
- Type Parameters:
T1
- The type of the first object.T2
- The type of the second object.T3
- The type of the third object.
- All Implemented Interfaces:
Serializable
A triple of things. The inner pairs are cached, as is the hashcode.
The cache is calculated on construction, and the objects inside the triple are thus expected to be immutable. If they aren't then the behaviour is undefined (and you shouldn't use this class).
- See Also:
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
Overridden hashcode.boolean
getA()
Gets the first element.getAB()
Gets the pair of the first and second elements.getAC()
Gets the pair of the first and third elements.getB()
Gets the second element.getBC()
Gets the pair of the second and third elements.getC()
Gets the third element.int
hashCode()
toString()
-
Field Details
-
a
The first element. -
b
The second element. -
c
The third element.
-
-
Constructor Details
-
CachedTriple
Constructs a CachedTriple.- Parameters:
a
- The first element.b
- The second element.c
- The third element.
-
-
Method Details
-
getA
Gets the first element.- Returns:
- The first element.
-
getB
Gets the second element.- Returns:
- The second element.
-
getC
Gets the third element.- Returns:
- The third element.
-
getAB
Gets the pair of the first and second elements.- Returns:
- A pair of the first and second elements.
-
getAC
Gets the pair of the first and third elements.- Returns:
- A pair of the first and third elements.
-
getBC
Gets the pair of the second and third elements.- Returns:
- A pair of the second and third elements.
-
hashCode
public int hashCode() -
calculateHashCode
public int calculateHashCode()Overridden hashcode. Checks to see if the types are ints or longs, and runs them through the mixing function if they are. Then XORs the two hashcodes together.- Returns:
- A 32-bit integer.
-
equals
-
toString
-