org.eclipse.ocl.examples.pivot.values.impl
Class TupleValueImpl
java.lang.Object
org.eclipse.ocl.examples.pivot.values.impl.AbstractValue
org.eclipse.ocl.examples.pivot.values.impl.TupleValueImpl
- All Implemented Interfaces:
- TupleValue, Value
public class TupleValueImpl
- extends AbstractValue
- implements TupleValue
UML implementation of a tuple value.
- Author:
- Christian W. Damus (cdamus)
Fields inherited from interface org.eclipse.ocl.examples.pivot.values.Value |
INVALID_NAME |
Methods inherited from class org.eclipse.ocl.examples.pivot.values.impl.AbstractValue |
asBagValue, asBoolean, asBooleanValue, asCollectionValue, asDouble, asElement, asElementValue, asInteger, asIntegerValue, asObjectValue, asOrderedCollectionValue, asOrderedSetValue, asRealValue, asSequenceValue, asSetValue, asString, asStringValue, asTypeValue, asUniqueCollectionValue, getValueFactory, isCollectionValue, isFalse, isIntegerValue, isInvalid, isNull, isRealValue, isTrue, isUndefined, isUnlimited, isUnlimitedNatural, oclToString, toIntegerValue, toRealValue, toString |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.eclipse.ocl.examples.pivot.values.Value |
asBagValue, asBoolean, asBooleanValue, asCollectionValue, asDouble, asElement, asElementValue, asInteger, asIntegerValue, asObjectValue, asOrderedCollectionValue, asOrderedSetValue, asRealValue, asSequenceValue, asSetValue, asString, asStringValue, asTypeValue, asUniqueCollectionValue, getValueFactory, isCollectionValue, isFalse, isIntegerValue, isInvalid, isNull, isRealValue, isTrue, isUndefined, isUnlimited, isUnlimitedNatural, oclToString, toIntegerValue, toRealValue, toString |
TupleValueImpl
public TupleValueImpl(ValueFactory valueFactory,
TupleType type,
java.util.Map<? extends TypedElement,Value> values)
- Initializes me with a map of part values.
- Parameters:
type
- my typevalues
- my parts
TupleValueImpl
public TupleValueImpl(ValueFactory valueFactory,
TupleType type,
Value firstValue,
Value secondValue)
- Convenience constructor to initialize me with a pair of part values as
required by the Collection::product() operation.
- Parameters:
type
- my typefirstValue
- my first valuesecondValue
- my second value
asObject
public java.lang.Object asObject()
- Specified by:
asObject
in interface Value
asValidValue
public Value asValidValue()
- Specified by:
asValidValue
in interface Value
getTupleType
public TupleType getTupleType()
- Description copied from interface:
TupleValue
- Obtains the tuple's type.
- Specified by:
getTupleType
in interface TupleValue
- Returns:
- its type
getValue
public Value getValue(java.lang.String partName)
- Description copied from interface:
TupleValue
- Queries the value of the specified tuple part.
- Specified by:
getValue
in interface TupleValue
- Parameters:
partName
- the name of the part
- Returns:
- the corresponding value
getValue
public Value getValue(Property part)
- Description copied from interface:
TupleValue
- Queries the value of the specified tuple part.
- Specified by:
getValue
in interface TupleValue
- Parameters:
part
- the tuple part (as an attribute)
- Returns:
- the corresponding value
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in class java.lang.Object
getType
public Type getType(TypeManager typeManager,
Type staticType)
- Specified by:
getType
in interface Value
hashCode
public int hashCode()
- Overrides:
hashCode
in class java.lang.Object
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
toString
public static java.lang.String toString(CollectionValue c)
- Computes the string representation of a collection value using syntax
like OCL's collection literals (e.g., OrderedSet{...}) instead
of Java's default (i.e., [...]).
- Parameters:
c
- a collection (not null
)
- Returns:
- the string representation of the specified collection
- Since:
- 1.2