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

public class CachedTriple<T1,T2,T3> extends Object implements 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 Details

    • a

      protected final T1 a
    • b

      protected final T2 b
    • c

      protected final T3 c
  • Constructor Details

    • CachedTriple

      public CachedTriple(T1 a, T2 b, T3 c)
  • Method Details

    • getA

      public T1 getA()
    • getB

      public T2 getB()
    • getC

      public T3 getC()
    • getAB

      public CachedPair<T1,T2> getAB()
    • getAC

      public CachedPair<T1,T3> getAC()
    • getBC

      public CachedPair<T2,T3> getBC()
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • 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

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object