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

java.lang.Object
  extended by org.eclipse.ocl.examples.domain.values.impl.AbstractValue
      extended by org.eclipse.ocl.examples.domain.values.impl.AbstractedCollectionValue
          extended by org.eclipse.ocl.examples.domain.values.impl.AbstractCollectionValue<OrderedSet<Value>>
              extended by org.eclipse.ocl.examples.domain.values.impl.OrderedSetValueImpl
All Implemented Interfaces:
java.lang.Iterable<Value>, CollectionValue, OrderedSetValue, SequenceValue, UniqueCollectionValue, Value
Direct Known Subclasses:
OrderedSetValueImpl.Accumulator

public class OrderedSetValueImpl
extends AbstractCollectionValue<OrderedSet<Value>>
implements OrderedSetValue


Nested Class Summary
static class OrderedSetValueImpl.Accumulator
           
 
Field Summary
 
Fields inherited from class org.eclipse.ocl.examples.domain.values.impl.AbstractCollectionValue
elements
 
Fields inherited from class org.eclipse.ocl.examples.domain.values.impl.AbstractedCollectionValue
type
 
Fields inherited from class org.eclipse.ocl.examples.domain.values.impl.AbstractValue
valueFactory
 
Fields inherited from interface org.eclipse.ocl.examples.domain.values.Value
INVALID_NAME
 
Constructor Summary
OrderedSetValueImpl(ValueFactory valueFactory, DomainCollectionType type, java.util.Collection<? extends Value> elements)
           
OrderedSetValueImpl(ValueFactory valueFactory, DomainCollectionType type, OrderedSet<Value> elements)
           
OrderedSetValueImpl(ValueFactory valueFactory, DomainCollectionType type, Value... elements)
           
 
Method Summary
 OrderedSetValue append(Value object)
           
 OrderedSetValueImpl asOrderedSetValue()
           
 SequenceValue asSequenceValue()
           
 UniqueCollectionValue asUniqueCollectionValue()
           
 Value at(int index)
           
 boolean equals(java.lang.Object obj)
           
 OrderedSetValue excluding(Value value)
           
 Value first()
           
 OrderedSetValue flatten()
           
 java.lang.String getKind()
           
 OrderedSetValue including(Value value)
           
 IntegerValue indexOf(Value object)
           
 OrderedSetValue insertAt(int index, Value object)
           
static OrderedSetValue intersection(ValueFactory valueFactory, DomainCollectionType type, CollectionValue left, CollectionValue right)
           
 Value last()
           
 OrderedSetValue minus(UniqueCollectionValue set)
           
 OrderedSetValue prepend(Value object)
           
 OrderedSetValue reverse()
           
 OrderedSetValue sort(java.util.Comparator<Value> comparator)
           
 OrderedSetValue subOrderedSet(int lower, int upper)
           
 SequenceValue subSequence(int lower, int upper)
           
 OrderedSetValue symmetricDifference(UniqueCollectionValue set)
           
 SequenceValue toSequenceValue()
           
 void toString(java.lang.StringBuilder s, int lengthLimit)
           
static OrderedSetValue union(ValueFactory valueFactory, DomainCollectionType type, CollectionValue left, CollectionValue right)
           
 
Methods inherited from class org.eclipse.ocl.examples.domain.values.impl.AbstractCollectionValue
asBagValue, asEcoreObject, asSetValue, count, excludes, excludesAll, flatten, getBagType, getCollectionType, getElements, getElementType, getOrderedSetType, getSequenceType, getSetType, hashCode, includes, includesAll, intersection, intSize, iterator, maxMin, product, selectByKind, selectByType, sum, union
 
Methods inherited from class org.eclipse.ocl.examples.domain.values.impl.AbstractedCollectionValue
asCollection, asCollectionValue, asList, asObject, asValidValue, getActualType, getType, isCollectionValue, isEmpty, notEmpty, size, toString
 
Methods inherited from class org.eclipse.ocl.examples.domain.values.impl.AbstractValue
asBoolean, asBooleanValue, asDouble, asElement, asElementValue, asInteger, asIntegerValue, asNavigableObject, asObjectValue, asRealValue, asString, asStringValue, asTypeValue, getValueFactory, isFalse, isIntegerValue, isInvalid, isNull, isRealValue, isTrue, isUndefined, isUnlimited, isUnlimitedNatural, oclToString, toIntegerValue, toIteratorValue, toRealValue
 
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.CollectionValue
asCollection, asList, count, excludes, excludesAll, flatten, getCollectionType, includes, includesAll, intersection, intSize, isEmpty, iterator, maxMin, notEmpty, product, selectByKind, selectByType, size, sum, union
 
Methods inherited from interface org.eclipse.ocl.examples.domain.values.Value
asBagValue, asBoolean, asBooleanValue, asCollectionValue, asDouble, asEcoreObject, asElement, asElementValue, asInteger, asIntegerValue, asNavigableObject, asObject, asObjectValue, asRealValue, asSetValue, asString, asStringValue, asTypeValue, asValidValue, getActualType, getType, getValueFactory, isCollectionValue, isFalse, isIntegerValue, isInvalid, isNull, isRealValue, isTrue, isUndefined, isUnlimited, isUnlimitedNatural, oclToString, toIntegerValue, toIteratorValue, toRealValue
 

Constructor Detail

OrderedSetValueImpl

public OrderedSetValueImpl(ValueFactory valueFactory,
                           DomainCollectionType type,
                           Value... elements)

OrderedSetValueImpl

public OrderedSetValueImpl(ValueFactory valueFactory,
                           DomainCollectionType type,
                           java.util.Collection<? extends Value> elements)

OrderedSetValueImpl

public OrderedSetValueImpl(ValueFactory valueFactory,
                           DomainCollectionType type,
                           OrderedSet<Value> elements)
Method Detail

intersection

public static OrderedSetValue intersection(ValueFactory valueFactory,
                                           DomainCollectionType type,
                                           CollectionValue left,
                                           CollectionValue right)
                                    throws InvalidValueException
Throws:
InvalidValueException

union

public static OrderedSetValue union(ValueFactory valueFactory,
                                    DomainCollectionType type,
                                    CollectionValue left,
                                    CollectionValue right)
                             throws InvalidValueException
Throws:
InvalidValueException

append

public OrderedSetValue append(Value object)
                       throws InvalidValueException
Specified by:
append in interface SequenceValue
Throws:
InvalidValueException

asOrderedSetValue

public OrderedSetValueImpl asOrderedSetValue()
Specified by:
asOrderedSetValue in interface Value
Overrides:
asOrderedSetValue in class AbstractCollectionValue<OrderedSet<Value>>

asSequenceValue

public SequenceValue asSequenceValue()
Specified by:
asSequenceValue in interface Value
Overrides:
asSequenceValue in class AbstractCollectionValue<OrderedSet<Value>>

asUniqueCollectionValue

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

at

public Value at(int index)
         throws InvalidValueException
Specified by:
at in interface SequenceValue
Throws:
InvalidValueException

equals

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

excluding

public OrderedSetValue excluding(Value value)
Specified by:
excluding in interface CollectionValue

first

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

flatten

public OrderedSetValue flatten()
                        throws InvalidValueException
Specified by:
flatten in interface CollectionValue
Throws:
InvalidValueException

getKind

public java.lang.String getKind()
Specified by:
getKind in interface CollectionValue

including

public OrderedSetValue including(Value value)
                          throws InvalidValueException
Specified by:
including in interface CollectionValue
Throws:
InvalidValueException

indexOf

public IntegerValue indexOf(Value object)
                     throws InvalidValueException
Specified by:
indexOf in interface SequenceValue
Throws:
InvalidValueException

insertAt

public OrderedSetValue insertAt(int index,
                                Value object)
                         throws InvalidValueException
Specified by:
insertAt in interface SequenceValue
Throws:
InvalidValueException

last

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

minus

public OrderedSetValue minus(UniqueCollectionValue set)
                      throws InvalidValueException
Specified by:
minus in interface UniqueCollectionValue
Throws:
InvalidValueException

prepend

public OrderedSetValue prepend(Value object)
                        throws InvalidValueException
Specified by:
prepend in interface SequenceValue
Throws:
InvalidValueException

reverse

public OrderedSetValue reverse()
Specified by:
reverse in interface SequenceValue

sort

public OrderedSetValue sort(java.util.Comparator<Value> comparator)
Specified by:
sort in interface CollectionValue

subOrderedSet

public OrderedSetValue subOrderedSet(int lower,
                                     int upper)
Specified by:
subOrderedSet in interface OrderedSetValue

subSequence

public SequenceValue subSequence(int lower,
                                 int upper)
                          throws InvalidValueException
Specified by:
subSequence in interface SequenceValue
Throws:
InvalidValueException

symmetricDifference

public OrderedSetValue symmetricDifference(UniqueCollectionValue set)
Specified by:
symmetricDifference in interface UniqueCollectionValue

toSequenceValue

public SequenceValue toSequenceValue()
Specified by:
toSequenceValue in interface CollectionValue

toString

public void toString(java.lang.StringBuilder s,
                     int lengthLimit)
Specified by:
toString in interface Value
Overrides:
toString in class AbstractedCollectionValue