Class Tuple


  • public class Tuple
    extends Object
    Ysld Tuple implementation.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      Object at​(int i)  
      boolean isNull()  
      static Tuple of​(int n)
      Returns an empty tuple of length n.
      static Tuple of​(Object... values)
      Return a tuple comprised of the passed values
      Tuple parse​(Object obj)
      Parse an object to this Tuple
      Tuple parse​(List<?> seq)
      Parse the values of seq and write them to this Tuple
      String strAt​(int i)  
      List<?> toList()
      Return this tuple as a List.
      String toString()  
      • Methods inherited from class Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Method Detail

      • of

        public static Tuple of​(Object... values)
        Return a tuple comprised of the passed values
      • of

        public static Tuple of​(int n)
        Returns an empty tuple of length n.
      • parse

        public Tuple parse​(List<?> seq)
                    throws IllegalArgumentException
        Parse the values of seq and write them to this Tuple
        Throws:
        IllegalArgumentException - if seq and this differ in length
      • parse

        public Tuple parse​(Object obj)
                    throws IllegalArgumentException
        Parse an object to this Tuple
        Throws:
        IllegalArgumentException - if obj cannot be parsed to a Tuple
      • at

        public Object at​(int i)
        Returns:
        the ith value of the tuple
      • strAt

        public String strAt​(int i)
        Returns:
        the ith value of the tuple, as a String.
      • toString

        public String toString()
        Overrides:
        toString in class Object
        Returns:
        A String representation of the tuple, of the form "(a, b)".
      • toList

        public List<?> toList()
        Return this tuple as a List.
      • isNull

        public boolean isNull()
        Returns:
        true if all values of the tuple are null, false otherwise.