Class Tuple

java.lang.Object
org.eclipse.m2m.atl.emftvm.util.Tuple

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

    • Tuple

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

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

    • fromMap

      public static Tuple fromMap(Map<String,? extends 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(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 Object get(Object name)
      Returns the value for name.
      Parameters:
      name - the element name
      Returns:
      the value for name
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

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

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

      public 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: