Class Tuple

    • Constructor Detail

      • Tuple

        public Tuple()
    • Method Detail

      • getField

        public abstract <T> T getField​(int pos)
        Gets the field at the specified position.
        Parameters:
        pos - The position of the field, zero indexed.
        Returns:
        The field at the specified position.
        Throws:
        IndexOutOfBoundsException - Thrown, if the position is negative, or equal to, or larger than the number of fields.
      • getFieldNotNull

        public <T> T getFieldNotNull​(int pos)
        Gets the field at the specified position, throws NullFieldException if the field is null. Used for comparing key fields.
        Parameters:
        pos - The position of the field, zero indexed.
        Returns:
        The field at the specified position.
        Throws:
        IndexOutOfBoundsException - Thrown, if the position is negative, or equal to, or larger than the number of fields.
        NullFieldException - Thrown, if the field at pos is null.
      • setField

        public abstract <T> void setField​(T value,
                                          int pos)
        Sets the field at the specified position.
        Parameters:
        value - The value to be assigned to the field at the specified position.
        pos - The position of the field, zero indexed.
        Throws:
        IndexOutOfBoundsException - Thrown, if the position is negative, or equal to, or larger than the number of fields.
      • getArity

        public abstract int getArity()
        Gets the number of field in the tuple (the tuple arity).
        Returns:
        The number of fields in the tuple.
      • copy

        public abstract <T extends Tuple> T copy()
        Shallow tuple copy.
        Returns:
        A new Tuple with the same fields as this.
      • getTupleClass

        public static Class<? extends Tuple> getTupleClass​(int arity)
        Gets the class corresponding to the tuple of the given arity (dimensions). For example, getTupleClass(3) will return the Tuple3.class.
        Parameters:
        arity - The arity of the tuple class to get.
        Returns:
        The tuple class with the given arity.
      • newInstance

        public static Tuple newInstance​(int arity)