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

java.lang.Object
  extended by org.eclipse.ocl.examples.domain.values.impl.AbstractValue
      extended by org.eclipse.ocl.examples.domain.values.impl.AbstractUndefinedValue
          extended by org.eclipse.ocl.examples.domain.values.impl.AbstractUndefinedCollectionValue
              extended by org.eclipse.ocl.examples.domain.values.impl.InvalidValueImpl
All Implemented Interfaces:
java.lang.Comparable<NumericValue>, java.lang.Iterable<Value>, BagValue, BooleanValue, CollectionValue, ElementValue, IntegerValue, InvalidValue, NullValue, NumericValue, ObjectValue, OrderedSetValue, RealValue, SequenceValue, SetValue, StringValue, TypeValue, UniqueCollectionValue, UnlimitedValue, Value
Direct Known Subclasses:
OCLConsolePage.ExceptionValue

public class InvalidValueImpl
extends AbstractUndefinedCollectionValue
implements InvalidValue


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.eclipse.ocl.examples.domain.values.BooleanValue
BooleanValue.Accumulator
 
Nested classes/interfaces inherited from interface org.eclipse.ocl.examples.domain.values.IntegerValue
IntegerValue.Accumulator
 
Field Summary
protected  InvalidEvaluationException exception
           
 
Fields inherited from class org.eclipse.ocl.examples.domain.values.impl.AbstractValue
valueFactory
 
Constructor Summary
InvalidValueImpl(ValueFactory valueFactory)
           
InvalidValueImpl(ValueFactory valueFactory, InvalidEvaluationException exception)
           
 
Method Summary
 BagValue asBagValue()
           
 boolean asBoolean()
           
 BooleanValue asBooleanValue()
           
 CollectionValue asCollectionValue()
           
 java.lang.Double asDouble()
           
 java.lang.Object asEcoreObject()
          Return the Ecore representation of this value.
 DomainElement asElement()
           
 ElementValue asElementValue()
           
 java.lang.Integer asInteger()
           
 IntegerValue asIntegerValue()
           
 org.eclipse.emf.ecore.EObject asNavigableObject()
           
 ObjectValue asObjectValue()
           
 OrderedSetValue asOrderedSetValue()
           
 RealValue asRealValue()
           
 SequenceValue asSequenceValue()
           
 SetValue asSetValue()
           
 java.lang.String asString()
           
 StringValue asStringValue()
           
 TypeValue asTypeValue()
           
 UniqueCollectionValue asUniqueCollectionValue()
           
 Value asValidValue()
           
 boolean equals(java.lang.Object obj)
           
 java.lang.Exception getException()
           
 DomainType getType()
          Return the type of this value determined from its construction context.
 int hashCode()
           
 boolean isInvalid()
           
 IntegerValue toIntegerValue()
           
 java.util.Iterator<Value> toIteratorValue()
           
 RealValue toRealValue()
           
 java.lang.String toString()
           
 
Methods inherited from class org.eclipse.ocl.examples.domain.values.impl.AbstractUndefinedCollectionValue
append, asCollection, asList, at, count, createNew, excludes, excludesAll, excluding, first, flatten, flatten, getCollectionType, getKind, includes, includesAll, including, indexOf, insertAt, intersection, intSize, isEmpty, iterator, last, maxMin, minus, notEmpty, prepend, product, reverse, selectByKind, selectByType, size, sort, subOrderedSet, subSequence, sum, symmetricDifference, toSequenceValue, union
 
Methods inherited from class org.eclipse.ocl.examples.domain.values.impl.AbstractUndefinedValue
abs, add, add, asFalse, asObject, asTrue, bigDecimalValue, bigIntegerValue, compareTo, div, divide, divide, doubleValue, floor, getElement, getInstanceType, getObject, isUndefined, max, max, min, min, mod, multiply, multiply, negate, round, signum, stringValue, subtract, subtract, toInvalidValue
 
Methods inherited from class org.eclipse.ocl.examples.domain.values.impl.AbstractValue
getActualType, getValueFactory, isCollectionValue, isFalse, isIntegerValue, isNull, isRealValue, isTrue, isUnlimited, isUnlimitedNatural, oclToString, 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.IntegerValue
add, bigIntegerValue, div, divide, max, min, mod, multiply, subtract
 
Methods inherited from interface org.eclipse.ocl.examples.domain.values.RealValue
abs, add, divide, floor, max, min, multiply, round, signum, subtract
 
Methods inherited from interface org.eclipse.ocl.examples.domain.values.StringValue
stringValue
 
Methods inherited from interface org.eclipse.ocl.examples.domain.values.NumericValue
bigDecimalValue, doubleValue
 
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, asList, count, excludes, excludesAll, excluding, flatten, flatten, getCollectionType, getKind, includes, includesAll, including, intersection, intSize, isEmpty, iterator, maxMin, notEmpty, product, selectByKind, selectByType, size, sort, sum, toSequenceValue, union
 
Methods inherited from interface org.eclipse.ocl.examples.domain.values.TypeValue
getInstanceType
 
Methods inherited from interface org.eclipse.ocl.examples.domain.values.ElementValue
getElement
 
Methods inherited from interface org.eclipse.ocl.examples.domain.values.ObjectValue
getObject
 

Field Detail

exception

protected final InvalidEvaluationException exception
Constructor Detail

InvalidValueImpl

public InvalidValueImpl(ValueFactory valueFactory)

InvalidValueImpl

public InvalidValueImpl(ValueFactory valueFactory,
                        InvalidEvaluationException exception)
Method Detail

asEcoreObject

public java.lang.Object asEcoreObject()
Description copied from interface: Value
Return the Ecore representation of this value.

Specified by:
asEcoreObject in interface Value
Overrides:
asEcoreObject in class AbstractValue

asBagValue

public BagValue asBagValue()
                    throws InvalidValueException
Specified by:
asBagValue in interface Value
Overrides:
asBagValue in class AbstractValue
Throws:
InvalidValueException

asBoolean

public boolean asBoolean()
                  throws InvalidValueException
Specified by:
asBoolean in interface Value
Overrides:
asBoolean in class AbstractValue
Throws:
InvalidValueException

asBooleanValue

public BooleanValue asBooleanValue()
                            throws InvalidValueException
Specified by:
asBooleanValue in interface Value
Overrides:
asBooleanValue in class AbstractValue
Throws:
InvalidValueException

asCollectionValue

public CollectionValue asCollectionValue()
                                  throws InvalidValueException
Specified by:
asCollectionValue in interface Value
Overrides:
asCollectionValue in class AbstractValue
Throws:
InvalidValueException

asDouble

public java.lang.Double asDouble()
                          throws InvalidValueException
Specified by:
asDouble in interface Value
Overrides:
asDouble in class AbstractValue
Throws:
InvalidValueException

asElement

public DomainElement asElement()
Specified by:
asElement in interface Value
Overrides:
asElement in class AbstractValue

asElementValue

public ElementValue asElementValue()
                            throws InvalidValueException
Specified by:
asElementValue in interface Value
Overrides:
asElementValue in class AbstractValue
Throws:
InvalidValueException

asInteger

public java.lang.Integer asInteger()
                            throws InvalidValueException
Specified by:
asInteger in interface Value
Overrides:
asInteger in class AbstractValue
Throws:
InvalidValueException

asIntegerValue

public IntegerValue asIntegerValue()
                            throws InvalidValueException
Specified by:
asIntegerValue in interface Value
Overrides:
asIntegerValue in class AbstractValue
Throws:
InvalidValueException

asNavigableObject

public org.eclipse.emf.ecore.EObject asNavigableObject()
                                                throws InvalidValueException
Specified by:
asNavigableObject in interface Value
Overrides:
asNavigableObject in class AbstractValue
Throws:
InvalidValueException

asObjectValue

public ObjectValue asObjectValue()
                          throws InvalidValueException
Specified by:
asObjectValue in interface Value
Overrides:
asObjectValue in class AbstractValue
Throws:
InvalidValueException

asOrderedSetValue

public OrderedSetValue asOrderedSetValue()
                                  throws InvalidValueException
Specified by:
asOrderedSetValue in interface Value
Overrides:
asOrderedSetValue in class AbstractValue
Throws:
InvalidValueException

asRealValue

public RealValue asRealValue()
                      throws InvalidValueException
Specified by:
asRealValue in interface Value
Overrides:
asRealValue in class AbstractValue
Throws:
InvalidValueException

asSequenceValue

public SequenceValue asSequenceValue()
                              throws InvalidValueException
Specified by:
asSequenceValue in interface Value
Overrides:
asSequenceValue in class AbstractValue
Throws:
InvalidValueException

asSetValue

public SetValue asSetValue()
                    throws InvalidValueException
Specified by:
asSetValue in interface Value
Overrides:
asSetValue in class AbstractValue
Throws:
InvalidValueException

asString

public java.lang.String asString()
                          throws InvalidValueException
Specified by:
asString in interface Value
Overrides:
asString in class AbstractValue
Throws:
InvalidValueException

asStringValue

public StringValue asStringValue()
                          throws InvalidValueException
Specified by:
asStringValue in interface Value
Overrides:
asStringValue in class AbstractValue
Throws:
InvalidValueException

asTypeValue

public TypeValue asTypeValue()
                      throws InvalidValueException
Specified by:
asTypeValue in interface Value
Overrides:
asTypeValue in class AbstractValue
Throws:
InvalidValueException

asUniqueCollectionValue

public UniqueCollectionValue asUniqueCollectionValue()
                                              throws InvalidValueException
Specified by:
asUniqueCollectionValue in interface Value
Overrides:
asUniqueCollectionValue in class AbstractValue
Throws:
InvalidValueException

asValidValue

public Value asValidValue()
                   throws InvalidValueException
Specified by:
asValidValue in interface Value
Throws:
InvalidValueException

equals

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

getException

public java.lang.Exception getException()
Specified by:
getException in interface InvalidValue

getType

public DomainType getType()
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:
getType in interface Value

hashCode

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

isInvalid

public boolean isInvalid()
Specified by:
isInvalid in interface Value
Overrides:
isInvalid in class AbstractValue

toIntegerValue

public IntegerValue toIntegerValue()
                            throws InvalidValueException
Specified by:
toIntegerValue in interface NumericValue
Specified by:
toIntegerValue in interface Value
Overrides:
toIntegerValue in class AbstractValue
Throws:
InvalidValueException

toIteratorValue

public java.util.Iterator<Value> toIteratorValue()
                                          throws InvalidValueException
Specified by:
toIteratorValue in interface Value
Overrides:
toIteratorValue in class AbstractValue
Throws:
InvalidValueException

toRealValue

public RealValue toRealValue()
                      throws InvalidValueException
Specified by:
toRealValue in interface Value
Overrides:
toRealValue in class AbstractValue
Throws:
InvalidValueException

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object