Package org.eclipse.m2m.atl.emftvm.util
Class Tuple
- java.lang.Object
-
- org.eclipse.m2m.atl.emftvm.util.Tuple
-
public final class Tuple extends java.lang.Object
Reflective, immutable implementation of OCL Tuples.
-
-
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 thisTuple
's value map.boolean
equals(java.lang.Object o)
static Tuple
fromCalendar(java.util.Calendar cal)
Returns a newTuple
fromcal
.static Tuple
fromMap(java.util.Map<java.lang.String,? extends java.lang.Object> map)
Creates a newTuple
frommap
.java.lang.Object
get(java.lang.Object name)
Returns the value forname
.int
hashCode()
java.util.Date
toDate()
Returns aDate
instance using the fields of this tuple.
-
-
-
Method Detail
-
fromMap
public static Tuple fromMap(java.util.Map<java.lang.String,? extends java.lang.Object> map)
Creates a newTuple
frommap
.- Parameters:
map
- theMap
with tuple data- Returns:
- a new
Tuple
frommap
-
fromCalendar
public static Tuple fromCalendar(java.util.Calendar cal)
Returns a newTuple
fromcal
. 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 inputCalendar
- Returns:
- a new
Tuple
fromcal
-
get
public java.lang.Object get(java.lang.Object name)
Returns the value forname
.- Parameters:
name
- the element name- Returns:
- the value for
name
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
asMap
public java.util.Map<java.lang.String,? extends java.lang.Object> asMap()
Returns thisTuple
's value map.- Returns:
- this
Tuple
's value map
-
toDate
public java.util.Date toDate()
Returns aDate
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
-
-