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

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by java.lang.RuntimeException
              extended by org.eclipse.ocl.examples.domain.evaluation.DomainException
                  extended by org.eclipse.ocl.examples.domain.values.impl.UndefinedValueImpl
                      extended by org.eclipse.ocl.examples.domain.values.impl.InvalidValueException
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<RealValue>, java.lang.Iterable<java.lang.Object>, BagValue, CollectionValue, IntegerValue, InvalidValue, NullValue, ObjectValue, OCLValue, OrderedSetValue, RealValue, SequenceValue, SetValue, TupleValue, UniqueCollectionValue, UnlimitedValue, Value

public class InvalidValueException
extends UndefinedValueImpl
implements InvalidValue

An InvalidValueException wraps an InvalidValue and is used to return the InvalidValue to the caller. Exceptions are a is thrown when an Invalid Value arises during an evaluation, and when no EvaluationEnvironment is available to support throwing an InvalidEvaluationException. When such an environment is available the InvalidValueException is rethrown as an InvalidEvaluationException. * @generated NOT

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.eclipse.ocl.examples.domain.values.IntegerValue
IntegerValue.Accumulator
 
Nested classes/interfaces inherited from interface org.eclipse.ocl.examples.domain.values.OrderedSetValue
OrderedSetValue.Accumulator
 
Nested classes/interfaces inherited from interface org.eclipse.ocl.examples.domain.values.SetValue
SetValue.Accumulator
 
Field Summary
 
Fields inherited from interface org.eclipse.ocl.examples.domain.values.Value
INVALID_NAME
 
Constructor Summary
InvalidValueException(java.lang.Exception exception)
           
InvalidValueException(java.lang.Exception exception, java.lang.String message)
           
InvalidValueException(java.lang.Exception exception, java.lang.String messageTemplate, java.lang.Object... bindings)
           
InvalidValueException(java.lang.String messageTemplate, java.lang.Object... bindings)
           
 
Method Summary
 BagValue asBagValue()
           
 CollectionValue asCollectionValue()
           
 java.lang.Double asDouble()
           
 java.util.List<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.Number asNumber()
           
 ObjectValue asObjectValue()
           
 OrderedSetValue asOrderedSetValue()
           
 RealValue asRealValue()
           
 SequenceValue asSequenceValue()
           
 SetValue asSetValue()
           
 UniqueCollectionValue asUniqueCollectionValue()
           
 boolean equals(java.lang.Object obj)
           
protected  org.eclipse.emf.ecore.EClass eStaticClass()
           
 DomainType getType(DomainStandardLibrary standardLibrary)
           
 OclInvalidTypeId getTypeId()
          Return the type of this value determined from its construction context.
 int hashCode()
           
 int intValue()
           
 boolean isInvalid()
           
 boolean oclEquals(OCLValue thatValue)
          Return true if this is an equivalent OCL value to thatValue.
 int oclHashCode()
           
 
Methods inherited from class org.eclipse.ocl.examples.domain.values.impl.UndefinedValueImpl
abs, addInteger, addReal, append, asCollection, asList, asObject, asTupleValue, asUnlimitedNaturalValue, at, bigDecimalValue, bigIntegerValue, commutatedAdd, commutatedDiv, commutatedDivide, commutatedMod, commutatedMultiply, commutatedSubtract, compareTo, compareToInteger, compareToReal, compareToUnlimited, count, createNew, div, divideInteger, divideReal, divInteger, divUnlimited, doubleValue, excludes, excludesAll, excluding, first, flatten, flatten, floor, getElement, getElements, getInstanceType, getKind, getObject, getTypeName, getValue, getValue, includes, includesAll, including, indexOf, insertAt, intersection, intSize, isEmpty, isFalse, isIntegerValue, isOrdered, isTrue, isUndefined, isUnique, isUnlimited, isUnlimitedNatural, iterable, iterator, last, max, maxInteger, maxReal, maxUnlimited, min, minInteger, minReal, minUnlimited, minus, modInteger, modUnlimited, multiplyInteger, multiplyReal, negate, notEmpty, prepend, product, reverse, round, signum, size, sort, stringValue, subOrderedSet, subSequence, subtractInteger, subtractReal, symmetricDifference, toInvalidValue, toSequenceValue, toString, union
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.eclipse.ocl.examples.domain.values.NullValue
negate
 
Methods inherited from interface org.eclipse.ocl.examples.domain.values.ObjectValue
getObject
 
Methods inherited from interface org.eclipse.ocl.examples.domain.values.IntegerValue
addInteger, commutatedDiv, commutatedMod, compareToInteger, divideInteger, divInteger, divUnlimited, isUnlimitedNatural, maxInteger, minInteger, modInteger, modUnlimited, multiplyInteger, subtractInteger
 
Methods inherited from interface org.eclipse.ocl.examples.domain.values.RealValue
abs, addReal, bigDecimalValue, bigIntegerValue, commutatedAdd, commutatedDivide, commutatedMultiply, commutatedSubtract, compareToReal, compareToUnlimited, divideReal, doubleValue, floor, isIntegerValue, isUnlimited, max, maxReal, maxUnlimited, min, minReal, minUnlimited, multiplyReal, round, signum, subtractReal
 
Methods inherited from interface java.lang.Comparable
compareTo
 
Methods inherited from interface org.eclipse.ocl.examples.domain.values.OrderedSetValue
subOrderedSet
 
Methods inherited from interface org.eclipse.ocl.examples.domain.values.SequenceValue
append, at, first, indexOf, insertAt, last, prepend, reverse, subSequence
 
Methods inherited from interface org.eclipse.ocl.examples.domain.values.UniqueCollectionValue
minus, symmetricDifference
 
Methods inherited from interface org.eclipse.ocl.examples.domain.values.CollectionValue
asCollection, count, excludes, excludesAll, excluding, flatten, flatten, getElements, getKind, includes, includesAll, including, intersection, intSize, isEmpty, isOrdered, isUnique, iterable, iterator, notEmpty, product, size, sort, toSequenceValue, union
 
Methods inherited from interface org.eclipse.ocl.examples.domain.values.Value
asObject, asTupleValue, asUnlimitedNaturalValue, isUndefined, toString
 
Methods inherited from interface org.eclipse.ocl.examples.domain.values.TupleValue
getValue, getValue
 

Constructor Detail

InvalidValueException

public InvalidValueException(@Nullable
                             java.lang.Exception exception,
                             java.lang.String message)

InvalidValueException

public InvalidValueException(java.lang.String messageTemplate,
                             java.lang.Object... bindings)

InvalidValueException

public InvalidValueException(@NonNull
                             java.lang.Exception exception)

InvalidValueException

public InvalidValueException(@Nullable
                             java.lang.Exception exception,
                             java.lang.String messageTemplate,
                             java.lang.Object... bindings)
Method Detail

eStaticClass

protected org.eclipse.emf.ecore.EClass eStaticClass()

Generated

asBagValue

@NonNull
public BagValue asBagValue()
Specified by:
asBagValue in interface Value
Overrides:
asBagValue in class UndefinedValueImpl

asCollectionValue

@NonNull
public CollectionValue asCollectionValue()
Specified by:
asCollectionValue in interface Value
Overrides:
asCollectionValue in class UndefinedValueImpl

asDouble

@NonNull
public java.lang.Double asDouble()
Specified by:
asDouble in interface Value
Overrides:
asDouble in class UndefinedValueImpl

asEcoreObject

@NonNull
public java.util.List<java.lang.Object> asEcoreObject()
Description copied from interface: Value
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

Specified by:
asEcoreObject in interface CollectionValue
Specified by:
asEcoreObject in interface Value

asElement

public DomainElement asElement()
Specified by:
asElement in interface Value

asInteger

@NonNull
public java.lang.Integer asInteger()
Specified by:
asInteger in interface Value
Overrides:
asInteger in class UndefinedValueImpl

asIntegerValue

@NonNull
public IntegerValue asIntegerValue()
Specified by:
asIntegerValue in interface Value
Overrides:
asIntegerValue in class UndefinedValueImpl

asNavigableObject

@NonNull
public org.eclipse.emf.ecore.EObject asNavigableObject()
Specified by:
asNavigableObject in interface Value
Overrides:
asNavigableObject in class UndefinedValueImpl

asNumber

@NonNull
public java.lang.Number asNumber()
Specified by:
asNumber in interface RealValue
Overrides:
asNumber in class UndefinedValueImpl

asObjectValue

@NonNull
public ObjectValue asObjectValue()
Specified by:
asObjectValue in interface Value
Overrides:
asObjectValue in class UndefinedValueImpl

asOrderedSetValue

@NonNull
public OrderedSetValue asOrderedSetValue()
Specified by:
asOrderedSetValue in interface Value
Overrides:
asOrderedSetValue in class UndefinedValueImpl

asRealValue

@NonNull
public RealValue asRealValue()
Specified by:
asRealValue in interface Value
Overrides:
asRealValue in class UndefinedValueImpl

asSequenceValue

@NonNull
public SequenceValue asSequenceValue()
Specified by:
asSequenceValue in interface Value
Overrides:
asSequenceValue in class UndefinedValueImpl

asSetValue

@NonNull
public SetValue asSetValue()
Specified by:
asSetValue in interface Value
Overrides:
asSetValue in class UndefinedValueImpl

asUniqueCollectionValue

@NonNull
public UniqueCollectionValue asUniqueCollectionValue()
Specified by:
asUniqueCollectionValue in interface Value
Overrides:
asUniqueCollectionValue in class UndefinedValueImpl

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

getType

@NonNull
public DomainType getType(@NonNull
                                  DomainStandardLibrary standardLibrary)

getTypeId

@NonNull
public OclInvalidTypeId getTypeId()
Description copied from interface: Value
Return the type of this value determined from its construction context. In the case of collections this may differ from the actual type.

Specified by:
getTypeId in interface CollectionValue
Specified by:
getTypeId in interface NullValue
Specified by:
getTypeId in interface TupleValue
Specified by:
getTypeId in interface Value
Specified by:
getTypeId in class UndefinedValueImpl
Returns:
its type

intValue

public int intValue()
Specified by:
intValue in interface IntegerValue

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

isInvalid

public boolean isInvalid()
Specified by:
isInvalid in interface Value

oclEquals

public boolean oclEquals(@NonNull
                         OCLValue thatValue)
Description copied from interface: OCLValue
Return true if this is an equivalent OCL value to thatValue.

Note that the caller must check that the argument is an OCLValue and should also check for the shortcut case that this == thatValue. Implementations are therefore wasting time if they re-implement the shortcut.

Specified by:
oclEquals in interface OCLValue

oclHashCode

public int oclHashCode()
Specified by:
oclHashCode in interface OCLValue