org.eclipse.ocl.examples.domain.values.impl
Class AbstractValueFactory

java.lang.Object
  extended by org.eclipse.ocl.examples.domain.values.impl.AbstractValueFactory
All Implemented Interfaces:
ValueFactory
Direct Known Subclasses:
ExecutorValueFactory, PivotValueFactory

public abstract class AbstractValueFactory
extends java.lang.Object
implements ValueFactory


Field Summary
static java.math.BigInteger INTEGER_MAX_VALUE
           
static java.math.BigInteger INTEGER_MIN_VALUE
           
static java.math.BigInteger LONG_MAX_VALUE
           
static java.math.BigInteger LONG_MIN_VALUE
           
protected  DomainStandardLibrary standardLibrary
           
 
Constructor Summary
AbstractValueFactory(DomainStandardLibrary standardLibrary)
           
 
Method Summary
 BooleanValue booleanValueOf(boolean value)
           
 BagValue createBagOf(java.lang.Iterable<?> objects)
           
 BagValue createBagOf(java.lang.Object... objects)
           
 BagValue createBagValue(DomainCollectionType type, Bag<? extends Value> values)
           
 BagValue createBagValue(DomainCollectionType type, java.util.Collection<? extends Value> values)
           
 BagValue createBagValue(DomainCollectionType type, Value... values)
           
 BagValue createBagValue(Value... values)
           
 BooleanValue.Accumulator createBooleanAccumulatorValue()
           
 CollectionValue.Accumulator createCollectionAccumulatorValue(DomainCollectionType type)
           
 CollectionValue createCollectionValue(boolean isOrdered, boolean isUnique, java.util.Collection<Value> values)
           
 CollectionValue createCollectionValue(boolean isOrdered, boolean isUnique, DomainType elementType, java.util.Collection<Value> values)
          Creates a new OCL Collection of the specified ordering and uniqueness.
 CollectionValue createCollectionValue(boolean isOrdered, boolean isUnique, DomainType elementType, Value... values)
           
 CollectionValue createCollectionValue(boolean isOrdered, boolean isUnique, Value... values)
          Creates a new OCL Collection of the specified ordering and uniqueness.
 ElementValue createElementValue(DomainElement element)
           
 EnumerationLiteralValue createEnumerationLiteralValue(DomainEnumerationLiteral element)
           
 EnumerationLiteralValue createEnumerationLiteralValue(org.eclipse.emf.ecore.EEnumLiteral eEnumLiteral)
           
 EnumerationLiteralValue createEnumerationLiteralValue(org.eclipse.emf.common.util.Enumerator enumerator, org.eclipse.emf.ecore.EEnum eEnum)
           
 ObjectValue createEObjectValue(org.eclipse.emf.ecore.EObject eObject)
           
 InvalidValue createInvalidValue(InvalidEvaluationException exception)
           
 InvalidValue createInvalidValue(InvalidValueException exception)
           
 ObjectValue createObjectValue(java.lang.Object object)
           
 OrderedSetValue createOrderedSetOf(java.lang.Iterable<?> objects)
           
 OrderedSetValue createOrderedSetOf(java.lang.Object... objects)
           
 OrderedSetValue createOrderedSetValue(DomainCollectionType type, java.util.Collection<? extends Value> values)
           
 OrderedSetValue createOrderedSetValue(DomainCollectionType type, OrderedSet<? extends Value> values)
           
 OrderedSetValue createOrderedSetValue(DomainCollectionType type, Value... values)
           
 OrderedSetValue createOrderedSetValue(Value... values)
           
 IntegerRange createRange(IntegerValue firstInteger, IntegerValue lastInteger)
           
 SequenceValue createSequenceAccumulatorValue(DomainCollectionType type, java.util.List<Value> values)
           
 SequenceValue createSequenceOf(java.lang.Iterable<?> objects)
           
 SequenceValue createSequenceOf(java.lang.Object... objects)
           
 SequenceValue createSequenceRange(DomainCollectionType type, IntegerRange range)
           
 SequenceValue createSequenceValue(DomainCollectionType type, java.util.Collection<? extends Value> values)
           
 SequenceValue createSequenceValue(DomainCollectionType type, java.util.List<? extends Value> values)
           
 SequenceValue createSequenceValue(DomainCollectionType type, Value... values)
           
 SequenceValue createSequenceValue(Value... values)
           
 SetValue createSetOf(java.lang.Iterable<?> objects)
           
 SetValue createSetOf(java.lang.Object... objects)
           
 SetValue createSetValue(DomainCollectionType type, java.util.Collection<? extends Value> values)
           
 SetValue createSetValue(DomainCollectionType type, java.util.Set<? extends Value> values)
           
 SetValue createSetValue(DomainCollectionType type, Value... values)
           
 SetValue createSetValue(Value... values)
           
 TupleValue createTupleValue(DomainTupleType type, java.util.Map<? extends DomainTypedElement,Value> values)
           
 TypeValue createTypeValue(DomainType type)
           
 void dispose()
           
 java.lang.Object getEcoreValueOf(Value value)
           
 DomainType getElementType(java.lang.Iterable<Value> values)
           
 DomainType getElementType(Value... values)
           
 BooleanValue getFalse()
           
 InvalidValue getInvalid()
           
 NullValue getNull()
           
 IntegerValue getOne()
           
 DomainStandardLibrary getStandardLibrary()
           
 BooleanValue getTrue()
           
 UnlimitedValue getUnlimited()
           
 IntegerValue getZero()
           
 IntegerValue integerValueOf(java.math.BigInteger value)
           
 IntegerValue integerValueOf(int value)
           
 IntegerValue integerValueOf(long value)
           
 IntegerValue integerValueOf(java.lang.String aValue)
          Creates a BigInteger representation for aValue.
 RealValue realValueOf(java.math.BigDecimal value)
           
 RealValue realValueOf(double value)
           
 RealValue realValueOf(IntegerValue integerValue)
           
 RealValue realValueOf(java.lang.String aValue)
           
 StringValue stringValueOf(java.lang.String value)
           
 InvalidValue throwInvalidValueException(java.lang.String message, java.lang.Object... bindings)
           
 InvalidValue throwInvalidValueException(java.lang.Throwable e, java.lang.String message, java.lang.Object... bindings)
           
 DomainType typeOf(Value value, Value... values)
           
 Value valueOf(java.lang.Object object)
           
 Value valueOf(java.lang.Object eValue, org.eclipse.emf.ecore.EClassifier eClassifier)
           
 Value valueOf(java.lang.Object eValue, org.eclipse.emf.ecore.ETypedElement eFeature)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INTEGER_MAX_VALUE

public static final java.math.BigInteger INTEGER_MAX_VALUE

INTEGER_MIN_VALUE

public static final java.math.BigInteger INTEGER_MIN_VALUE

LONG_MAX_VALUE

public static final java.math.BigInteger LONG_MAX_VALUE

LONG_MIN_VALUE

public static final java.math.BigInteger LONG_MIN_VALUE

standardLibrary

protected final DomainStandardLibrary standardLibrary
Constructor Detail

AbstractValueFactory

public AbstractValueFactory(DomainStandardLibrary standardLibrary)
Method Detail

booleanValueOf

public BooleanValue booleanValueOf(boolean value)
Specified by:
booleanValueOf in interface ValueFactory

createBagOf

public BagValue createBagOf(java.lang.Object... objects)
Specified by:
createBagOf in interface ValueFactory

createBagOf

public BagValue createBagOf(java.lang.Iterable<?> objects)
Specified by:
createBagOf in interface ValueFactory

createBagValue

public BagValue createBagValue(DomainCollectionType type,
                               Value... values)
Specified by:
createBagValue in interface ValueFactory

createBagValue

public BagValue createBagValue(DomainCollectionType type,
                               Bag<? extends Value> values)
Specified by:
createBagValue in interface ValueFactory

createBagValue

public BagValue createBagValue(DomainCollectionType type,
                               java.util.Collection<? extends Value> values)
Specified by:
createBagValue in interface ValueFactory

createBagValue

public BagValue createBagValue(Value... values)
Specified by:
createBagValue in interface ValueFactory

createBooleanAccumulatorValue

public BooleanValue.Accumulator createBooleanAccumulatorValue()
Specified by:
createBooleanAccumulatorValue in interface ValueFactory

createCollectionAccumulatorValue

public CollectionValue.Accumulator createCollectionAccumulatorValue(DomainCollectionType type)
Specified by:
createCollectionAccumulatorValue in interface ValueFactory

createCollectionValue

public CollectionValue createCollectionValue(boolean isOrdered,
                                             boolean isUnique,
                                             Value... values)
Creates a new OCL Collection of the specified ordering and uniqueness.

Specified by:
createCollectionValue in interface ValueFactory
Parameters:
isOrdered - the required collection ordering
isUnique - the required collection uniqueness
values - the required collection contents
Returns:
the new collection

createCollectionValue

public CollectionValue createCollectionValue(boolean isOrdered,
                                             boolean isUnique,
                                             java.util.Collection<Value> values)
Specified by:
createCollectionValue in interface ValueFactory

createCollectionValue

public CollectionValue createCollectionValue(boolean isOrdered,
                                             boolean isUnique,
                                             DomainType elementType,
                                             Value... values)
Specified by:
createCollectionValue in interface ValueFactory

createCollectionValue

public CollectionValue createCollectionValue(boolean isOrdered,
                                             boolean isUnique,
                                             DomainType elementType,
                                             java.util.Collection<Value> values)
Creates a new OCL Collection of the specified ordering and uniqueness.

Specified by:
createCollectionValue in interface ValueFactory
Parameters:
isOrdered - the required collection ordering
isUnique - the required collection uniqueness
values - the required collection contents
Returns:
the new collection

createEObjectValue

public ObjectValue createEObjectValue(org.eclipse.emf.ecore.EObject eObject)
Specified by:
createEObjectValue in interface ValueFactory

createElementValue

public ElementValue createElementValue(DomainElement element)
Specified by:
createElementValue in interface ValueFactory

createEnumerationLiteralValue

public EnumerationLiteralValue createEnumerationLiteralValue(DomainEnumerationLiteral element)
Specified by:
createEnumerationLiteralValue in interface ValueFactory

createEnumerationLiteralValue

public EnumerationLiteralValue createEnumerationLiteralValue(org.eclipse.emf.ecore.EEnumLiteral eEnumLiteral)
Specified by:
createEnumerationLiteralValue in interface ValueFactory

createEnumerationLiteralValue

public EnumerationLiteralValue createEnumerationLiteralValue(org.eclipse.emf.common.util.Enumerator enumerator,
                                                             org.eclipse.emf.ecore.EEnum eEnum)
Specified by:
createEnumerationLiteralValue in interface ValueFactory

createInvalidValue

public InvalidValue createInvalidValue(InvalidEvaluationException exception)
Specified by:
createInvalidValue in interface ValueFactory

createInvalidValue

public InvalidValue createInvalidValue(InvalidValueException exception)
Specified by:
createInvalidValue in interface ValueFactory

createObjectValue

public ObjectValue createObjectValue(java.lang.Object object)
Specified by:
createObjectValue in interface ValueFactory

createOrderedSetOf

public OrderedSetValue createOrderedSetOf(java.lang.Iterable<?> objects)
Specified by:
createOrderedSetOf in interface ValueFactory

createOrderedSetOf

public OrderedSetValue createOrderedSetOf(java.lang.Object... objects)
Specified by:
createOrderedSetOf in interface ValueFactory

createOrderedSetValue

public OrderedSetValue createOrderedSetValue(DomainCollectionType type,
                                             Value... values)
Specified by:
createOrderedSetValue in interface ValueFactory

createOrderedSetValue

public OrderedSetValue createOrderedSetValue(DomainCollectionType type,
                                             OrderedSet<? extends Value> values)
Specified by:
createOrderedSetValue in interface ValueFactory

createOrderedSetValue

public OrderedSetValue createOrderedSetValue(DomainCollectionType type,
                                             java.util.Collection<? extends Value> values)
Specified by:
createOrderedSetValue in interface ValueFactory

createOrderedSetValue

public OrderedSetValue createOrderedSetValue(Value... values)
Specified by:
createOrderedSetValue in interface ValueFactory

createSequenceOf

public SequenceValue createSequenceOf(java.lang.Object... objects)
Specified by:
createSequenceOf in interface ValueFactory

createSequenceOf

public SequenceValue createSequenceOf(java.lang.Iterable<?> objects)
Specified by:
createSequenceOf in interface ValueFactory

createRange

public IntegerRange createRange(IntegerValue firstInteger,
                                IntegerValue lastInteger)
                         throws InvalidValueException
Specified by:
createRange in interface ValueFactory
Throws:
InvalidValueException

createSequenceAccumulatorValue

public SequenceValue createSequenceAccumulatorValue(DomainCollectionType type,
                                                    java.util.List<Value> values)
Specified by:
createSequenceAccumulatorValue in interface ValueFactory

createSequenceRange

public SequenceValue createSequenceRange(DomainCollectionType type,
                                         IntegerRange range)
Specified by:
createSequenceRange in interface ValueFactory

createSequenceValue

public SequenceValue createSequenceValue(DomainCollectionType type,
                                         Value... values)
Specified by:
createSequenceValue in interface ValueFactory

createSequenceValue

public SequenceValue createSequenceValue(DomainCollectionType type,
                                         java.util.List<? extends Value> values)
Specified by:
createSequenceValue in interface ValueFactory

createSequenceValue

public SequenceValue createSequenceValue(DomainCollectionType type,
                                         java.util.Collection<? extends Value> values)
Specified by:
createSequenceValue in interface ValueFactory

createSequenceValue

public SequenceValue createSequenceValue(Value... values)
Specified by:
createSequenceValue in interface ValueFactory

createSetOf

public SetValue createSetOf(java.lang.Object... objects)
Specified by:
createSetOf in interface ValueFactory

createSetOf

public SetValue createSetOf(java.lang.Iterable<?> objects)
Specified by:
createSetOf in interface ValueFactory

createSetValue

public SetValue createSetValue(DomainCollectionType type,
                               Value... values)
Specified by:
createSetValue in interface ValueFactory

createSetValue

public SetValue createSetValue(DomainCollectionType type,
                               java.util.Set<? extends Value> values)
Specified by:
createSetValue in interface ValueFactory

createSetValue

public SetValue createSetValue(DomainCollectionType type,
                               java.util.Collection<? extends Value> values)
Specified by:
createSetValue in interface ValueFactory

createSetValue

public SetValue createSetValue(Value... values)
Specified by:
createSetValue in interface ValueFactory

createTupleValue

public TupleValue createTupleValue(DomainTupleType type,
                                   java.util.Map<? extends DomainTypedElement,Value> values)
Specified by:
createTupleValue in interface ValueFactory

createTypeValue

public TypeValue createTypeValue(DomainType type)
Specified by:
createTypeValue in interface ValueFactory

dispose

public void dispose()
Specified by:
dispose in interface ValueFactory

getElementType

public DomainType getElementType(Value... values)
Specified by:
getElementType in interface ValueFactory

getEcoreValueOf

public final java.lang.Object getEcoreValueOf(Value value)
Specified by:
getEcoreValueOf in interface ValueFactory

getElementType

public DomainType getElementType(java.lang.Iterable<Value> values)
Specified by:
getElementType in interface ValueFactory

getFalse

public BooleanValue getFalse()
Specified by:
getFalse in interface ValueFactory

getInvalid

public InvalidValue getInvalid()
Specified by:
getInvalid in interface ValueFactory

getNull

public NullValue getNull()
Specified by:
getNull in interface ValueFactory

getOne

public IntegerValue getOne()
Specified by:
getOne in interface ValueFactory

getStandardLibrary

public final DomainStandardLibrary getStandardLibrary()
Specified by:
getStandardLibrary in interface ValueFactory

getTrue

public BooleanValue getTrue()
Specified by:
getTrue in interface ValueFactory

getUnlimited

public UnlimitedValue getUnlimited()
Specified by:
getUnlimited in interface ValueFactory

getZero

public IntegerValue getZero()
Specified by:
getZero in interface ValueFactory

integerValueOf

public IntegerValue integerValueOf(int value)
Specified by:
integerValueOf in interface ValueFactory

integerValueOf

public IntegerValue integerValueOf(long value)
Specified by:
integerValueOf in interface ValueFactory

integerValueOf

public IntegerValue integerValueOf(java.math.BigInteger value)
Specified by:
integerValueOf in interface ValueFactory

integerValueOf

public IntegerValue integerValueOf(java.lang.String aValue)
                            throws InvalidValueException
Creates a BigInteger representation for aValue.

Specified by:
integerValueOf in interface ValueFactory
Parameters:
aValue - the string representation of a (non-negative) integer number
Returns:
the numeric representation
Throws:
InvalidValueException - if representation cannot be created

realValueOf

public RealValue realValueOf(double value)
Specified by:
realValueOf in interface ValueFactory

realValueOf

public RealValue realValueOf(java.math.BigDecimal value)
Specified by:
realValueOf in interface ValueFactory

realValueOf

public RealValue realValueOf(IntegerValue integerValue)
Specified by:
realValueOf in interface ValueFactory

realValueOf

public RealValue realValueOf(java.lang.String aValue)
                      throws InvalidValueException
Specified by:
realValueOf in interface ValueFactory
Throws:
InvalidValueException

stringValueOf

public StringValue stringValueOf(java.lang.String value)
Specified by:
stringValueOf in interface ValueFactory

throwInvalidValueException

public InvalidValue throwInvalidValueException(java.lang.String message,
                                               java.lang.Object... bindings)
                                        throws InvalidValueException
Specified by:
throwInvalidValueException in interface ValueFactory
Throws:
InvalidValueException

throwInvalidValueException

public InvalidValue throwInvalidValueException(java.lang.Throwable e,
                                               java.lang.String message,
                                               java.lang.Object... bindings)
                                        throws InvalidValueException
Throws:
InvalidValueException

typeOf

public DomainType typeOf(Value value,
                         Value... values)
Specified by:
typeOf in interface ValueFactory

valueOf

public Value valueOf(java.lang.Object object)
Specified by:
valueOf in interface ValueFactory

valueOf

public Value valueOf(java.lang.Object eValue,
                     org.eclipse.emf.ecore.EClassifier eClassifier)
Specified by:
valueOf in interface ValueFactory

valueOf

public Value valueOf(java.lang.Object eValue,
                     org.eclipse.emf.ecore.ETypedElement eFeature)
Specified by:
valueOf in interface ValueFactory