Class Tuple0

  • All Implemented Interfaces:
    Serializable

    @Public
    public class Tuple0
    extends Tuple
    A tuple with 0 fields.

    The Tuple0 is a soft singleton, i.e., there is a "singleton" instance, but it does not prevent creation of additional instances.

    See Also:
    Tuple, Serialized Form
    • Field Detail

      • INSTANCE

        public static final Tuple0 INSTANCE
    • Constructor Detail

      • Tuple0

        public Tuple0()
    • Method Detail

      • getArity

        public int getArity()
        Description copied from class: Tuple
        Gets the number of field in the tuple (the tuple arity).
        Specified by:
        getArity in class Tuple
        Returns:
        The number of fields in the tuple.
      • getField

        public <T> T getField​(int pos)
        Description copied from class: Tuple
        Gets the field at the specified position.
        Specified by:
        getField in class Tuple
        Parameters:
        pos - The position of the field, zero indexed.
        Returns:
        The field at the specified position.
      • setField

        public <T> void setField​(T value,
                                 int pos)
        Description copied from class: Tuple
        Sets the field at the specified position.
        Specified by:
        setField in class Tuple
        Parameters:
        value - The value to be assigned to the field at the specified position.
        pos - The position of the field, zero indexed.
      • copy

        public Tuple0 copy()
        Shallow tuple copy.
        Specified by:
        copy in class Tuple
        Returns:
        A new Tuple with the same fields as this.
      • toString

        public String toString()
        Creates a string representation of the tuple in the form "()".
        Overrides:
        toString in class Object
        Returns:
        The string representation of the tuple.
      • equals

        public boolean equals​(Object o)
        Deep equality for tuples by calling equals() on the tuple members.
        Overrides:
        equals in class Object
        Parameters:
        o - the object checked for equality
        Returns:
        true if this is equal to o.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object