Class Tuple

    • Method Detail

      • createEmpty

        public static Tuple createEmpty()
        Creates an empty tuple with empty tuple type "<>".
        Returns:
        tuple value
        API:
        This public API is available in IvyScript and Java. It has the visibility NOVICE.
      • readOnlyTuple

        public Tuple readOnlyTuple()
        Creates a read-only version of the given tuple.
        Returns:
        If this type is read-only, it is returned, otherwise a read-only copy of this tuple is returned.
        API:
        This public API is available in IvyScript and Java. It has the visibility EXPERT.
      • writableTuple

        public Tuple writableTuple()
        Creates a writable version of the given tuple.
        Returns:
        If this type is writable, it is returned, otherwise a writable copy of this tuple is returned.
        API:
        This public API is available in IvyScript and Java. It has the visibility EXPERT.
      • get

        public Object get​(int pos)
                   throws IndexOutOfBoundsException
        Gets the value of the member at the position.
        Parameters:
        pos - a 0-based position
        Returns:
        value of the member at the given position (may be null)
        Throws:
        IndexOutOfBoundsException - if position is invalid
        API:
        This public API is available in IvyScript and Java. It has the visibility EXPERT.
      • get

        public Object get​(String name)
                   throws NoSuchFieldException
        Gets the tuple value of the member with the given name.
        Parameters:
        name - the name of the member to get value of
        Returns:
        value of given member (may be null)
        Throws:
        NoSuchFieldException - if no member with given name exists
        API:
        This public API is available in IvyScript and Java. It has the visibility EXPERT.
      • size

        public int size()
        The size of this tuple (i.e. number of members/fields).
        Returns:
        tuple size
        API:
        This public API is available in IvyScript and Java. It has the visibility EXPERT.
      • isEmpty

        public boolean isEmpty()
        Check if this is the empty tuple value. This is the same as a check for size() == 0.
        Returns:
        true, if this tuple is the empty tuple
        API:
        This public API is available in IvyScript and Java. It has the visibility EXPERT.
      • hashCode

        public int hashCode()
        See Also:
        Object.hashCode()
        API:
        This public API is available in IvyScript and Java. It has the visibility EXPERT.
      • toString

        public String toString()
        Returns a string representation of this tuple.
        See Also:
        Object.toString()
        API:
        This public API is available in IvyScript and Java. It has the visibility NOVICE.