org.eclipse.ocl.examples.domain.values
Interface Value

All Known Subinterfaces:
BagValue, BagValue.Accumulator, CollectionValue, CollectionValue.Accumulator, IntegerValue, IntegerValue.Accumulator, InvalidValue, NullValue, ObjectValue, OrderedSetValue, OrderedSetValue.Accumulator, RealValue, SequenceValue, SequenceValue.Accumulator, SetValue, SetValue.Accumulator, TupleValue, UniqueCollectionValue, UnlimitedValue
All Known Implementing Classes:
BagValueImpl, BagValueImpl.Accumulator, BigIntegerValueImpl, CollectionValueImpl, IntegerValueImpl, IntIntegerValueImpl, InvalidValueException, JavaObjectValueImpl, LongIntegerValueImpl, NullValueImpl, NumberValueImpl, ObjectValueImpl, OrderedSetValueImpl, RangeOrderedSetValueImpl, RangeSequenceValueImpl, RealValueImpl, SequenceValueImpl, SetValueImpl, SetValueImpl.Accumulator, SortedByIteration.SortingValue, SparseOrderedSetValueImpl, SparseOrderedSetValueImpl.Accumulator, SparseSequenceValueImpl, SparseSequenceValueImpl.Accumulator, TupleValueImpl, UndefinedValueImpl, UnlimitedValueImpl, ValueImpl

public interface Value

A value support wrapping/boxing a value whose Java implementation does not comply with OCL semantics, primarily that equal values return true from Object.equals(Object) but also for variant metamodel elements.

A boxed value is not needed for Boolean and String that are well-behaved.

A boxed value is needed for Integer and Double, since in OCL 4 is equal to 4.0 and since multiple implementation classes exist to support growth between unlimited numeric ranges.

A boxed value is needed for EnumerationLiterals since distinct Pivot, Ecore, UML variants may exist.

A boxed value is needed for types since distinct Pivot, Ecore, UML variants may exist.

A boxed value is useful/needed for collections to provide OCL polymorphism.

A boxed value is not needed for the large number of ordinary EObjects not in the above list.

asXXX returns a non-null XXX if self is convertible to an XXX and is not NullValue/InvalidValue throws an InvalidValueException for a NullValue/InvalidValue. A Value object may be converted if the conversion to XXX is exact and type conformant.

isXXX returns an XXX-related value if self is an XXX and is not a NullValue/InvalidValue, returns null otherwise.


Field Summary
static java.lang.String INVALID_NAME
           
 
Method Summary
 BagValue asBagValue()
           
 CollectionValue asCollectionValue()
           
 java.lang.Double asDouble()
           
 java.lang.Object asEcoreObject()
          Return the Ecore representation of this value.
 DomainElement asElement()
           
 java.lang.Integer asInteger()
           
 IntegerValue asIntegerValue()
           
 org.eclipse.emf.ecore.EObject asNavigableObject()
           
 java.lang.Object asObject()
           
 ObjectValue asObjectValue()
           
 OrderedSetValue asOrderedSetValue()
           
 RealValue asRealValue()
           
 SequenceValue asSequenceValue()
           
 SetValue asSetValue()
           
 TupleValue asTupleValue()
           
 UniqueCollectionValue asUniqueCollectionValue()
           
 Value asUnlimitedNaturalValue()
           
 TypeId getTypeId()
          Return the type of this value determined from its construction context.
 boolean isInvalid()
           
 boolean isUndefined()
           
 void toString(java.lang.StringBuilder s, int sizeLimit)
           
 

Field Detail

INVALID_NAME

static final java.lang.String INVALID_NAME
See Also:
Constant Field Values
Generated
NOT
Method Detail

asBagValue

@NonNull
BagValue asBagValue()
Generated
NOT

asCollectionValue

@NonNull
CollectionValue asCollectionValue()
Generated
NOT

asDouble

@NonNull
java.lang.Double asDouble()
Generated
NOT

asEcoreObject

java.lang.Object asEcoreObject()
Return the Ecore representation of this value.

An thrown exception for an invalid OCL value.

Java-null for a null OCL value

Objects for other things

Generated
NOT

asElement

DomainElement asElement()
Generated
NOT

asInteger

@NonNull
java.lang.Integer asInteger()
Generated
NOT

asIntegerValue

@NonNull
IntegerValue asIntegerValue()
Generated
NOT

asNavigableObject

@NonNull
org.eclipse.emf.ecore.EObject asNavigableObject()
Generated
NOT

asObject

@NonNull
java.lang.Object asObject()
Generated
NOT

asObjectValue

@NonNull
ObjectValue asObjectValue()
Generated
NOT

asOrderedSetValue

@NonNull
OrderedSetValue asOrderedSetValue()
Generated
NOT

asRealValue

@NonNull
RealValue asRealValue()
Generated
NOT

asSequenceValue

@NonNull
SequenceValue asSequenceValue()
Generated
NOT

asSetValue

@NonNull
SetValue asSetValue()
Generated
NOT

asTupleValue

@NonNull
TupleValue asTupleValue()
Generated
NOT

asUniqueCollectionValue

@NonNull
UniqueCollectionValue asUniqueCollectionValue()
Generated
NOT

asUnlimitedNaturalValue

@NonNull
Value asUnlimitedNaturalValue()
Generated
NOT

getTypeId

@NonNull
TypeId getTypeId()
Return the type of this value determined from its construction context. In the case of collections this may differ from the actual type.

Generated
NOT

isInvalid

boolean isInvalid()
Generated
NOT

isUndefined

boolean isUndefined()
Generated
NOT

toString

void toString(@NonNull
              java.lang.StringBuilder s,
              int sizeLimit)
Generated
NOT