Class Tuple


  • public final class Tuple
    extends java.lang.Object
    Reflective, immutable implementation of OCL Tuples.
    • Constructor Summary

      Constructors 
      Constructor Description
      Tuple()
      Creates a new empty Tuple.
      Tuple​(java.util.Map<java.lang.String,​? extends java.lang.Object> map)
      Creates a new Tuple initialized with the given map.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.Map<java.lang.String,​? extends java.lang.Object> asMap()
      Returns this Tuple's value map.
      boolean equals​(java.lang.Object o)
      static Tuple fromCalendar​(java.util.Calendar cal)
      Returns a new Tuple from cal.
      static Tuple fromMap​(java.util.Map<java.lang.String,​? extends java.lang.Object> map)
      Creates a new Tuple from map.
      java.lang.Object get​(java.lang.Object name)
      Returns the value for name.
      int hashCode()
      java.util.Date toDate()
      Returns a Date instance using the fields of this tuple.
      • Methods inherited from class java.lang.Object

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

      • Tuple

        public Tuple()
        Creates a new empty Tuple.
      • Tuple

        public Tuple​(java.util.Map<java.lang.String,​? extends java.lang.Object> map)
        Creates a new Tuple initialized with the given map.
        Parameters:
        map - the map with tuple key-value pairs
    • Method Detail

      • fromMap

        public static Tuple fromMap​(java.util.Map<java.lang.String,​? extends java.lang.Object> map)
        Creates a new Tuple from map.
        Parameters:
        map - the Map with tuple data
        Returns:
        a new Tuple from map
      • fromCalendar

        public static Tuple fromCalendar​(java.util.Calendar cal)
        Returns a new Tuple from cal. Supported fields: timezone, year, month, day_of_month, day_of_week, day_of_week_in_month, day_of_year, era, hour, hour_of_day, minute, second, millisecond, am_pm, week_of_month, week_of_year.
        Parameters:
        cal - the input Calendar
        Returns:
        a new Tuple from cal
      • get

        public java.lang.Object get​(java.lang.Object name)
        Returns the value for name.
        Parameters:
        name - the element name
        Returns:
        the value for name
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

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

        public java.util.Map<java.lang.String,​? extends java.lang.Object> asMap()
        Returns this Tuple's value map.
        Returns:
        this Tuple's value map
      • toDate

        public java.util.Date toDate()
        Returns a Date instance using the fields of this tuple. Supported fields: timezone, locale, year, month, day_of_month, day_of_week, day_of_week_in_month, day_of_year, era, hour, hour_of_day, minute, second, millisecond, am_pm, week_of_month, week_of_year.
        Returns:
        a Date instance using the fields of this tuple
        See Also:
        Calendar