Class Tuple2<T1,​T2>

  • All Implemented Interfaces:
    Tuple, java.lang.Comparable<Tuple2<T1,​T2>>

    public final class Tuple2<T1,​T2>
    extends java.lang.Object
    implements Tuple, java.lang.Comparable<Tuple2<T1,​T2>>
    A Tuple that has 2 values.
    Author:
    Andre Breves
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int compareTo​(Tuple2<T1,​T2> other)  
      int degree()
      Returns the value count of this Tuple.
      boolean equals​(java.lang.Object obj)  
      int hashCode()  
      static <T1,​T2>
      Tuple2<T1,​T2>
      of​(T1 v1, T2 v2)
      Returns a Tuple that has 2 values.
      T1 v1()
      Returns the 1st value of this Tuple.
      T2 v2()
      Returns the 2nd value of this Tuple.
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • of

        public static <T1,​T2> Tuple2<T1,​T2> of​(T1 v1,
                                                           T2 v2)
        Returns a Tuple that has 2 values.
      • v1

        public T1 v1()
        Returns the 1st value of this Tuple.
      • v2

        public T2 v2()
        Returns the 2nd value of this Tuple.
      • degree

        public int degree()
        Description copied from interface: Tuple
        Returns the value count of this Tuple.
        Specified by:
        degree in interface Tuple
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • compareTo

        public int compareTo​(Tuple2<T1,​T2> other)
        Specified by:
        compareTo in interface java.lang.Comparable<T1>