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

java.lang.Object
  extended by org.eclipse.ocl.examples.domain.values.util.ValuesUtil
      extended by org.eclipse.ocl.examples.domain.values.impl.ValueImpl
          extended by org.eclipse.ocl.examples.domain.values.impl.CollectionValueImpl
              extended by org.eclipse.ocl.examples.domain.values.impl.SequenceValueImpl
All Implemented Interfaces:
java.lang.Iterable<java.lang.Object>, CollectionValue, OrderedCollectionValue, SequenceValue, Value
Direct Known Subclasses:
RangeSequenceValueImpl, SparseSequenceValueImpl

public abstract class SequenceValueImpl
extends CollectionValueImpl
implements SequenceValue

Generated
NOT

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.eclipse.ocl.examples.domain.values.SequenceValue
SequenceValue.Accumulator
 
Field Summary
 
Fields inherited from class org.eclipse.ocl.examples.domain.values.impl.CollectionValueImpl
elements, EMPTY_ITERATOR, typeId
 
Fields inherited from class org.eclipse.ocl.examples.domain.values.util.ValuesUtil
EMPTY_BAG, EMPTY_SET, FALSE_VALUE, INTEGER_MAX_VALUE, INTEGER_MIN_VALUE, INVALID_VALUE, LONG_MAX_VALUE, LONG_MIN_VALUE, NULL_STRING, NULL_VALUE, ONE_VALUE, TRUE_VALUE, UNLIMITED_VALUE, ZERO_VALUE
 
Fields inherited from interface org.eclipse.ocl.examples.domain.values.Value
INVALID_NAME
 
Constructor Summary
SequenceValueImpl(CollectionTypeId typeId, java.util.List<? extends java.lang.Object> values)
           
 
Method Summary
 OrderedCollectionValue append(java.lang.Object object)
           
 OrderedCollectionValue appendAll(OrderedCollectionValue objects)
           
 java.util.List<? extends java.lang.Object> asList()
           
 OrderedCollectionValue asOrderedCollectionValue()
           
 SequenceValue asSequenceValue()
           
 java.lang.Object at(int index)
           
 boolean equals(java.lang.Object obj)
           
protected  org.eclipse.emf.ecore.EClass eStaticClass()
           
 SequenceValue excluding(java.lang.Object value)
           
 SequenceValue excludingAll(CollectionValue values)
           
 java.lang.Object first()
           
 SequenceValue flatten()
           
 java.util.List<? extends java.lang.Object> getElements()
           
 java.lang.String getKind()
           
 SequenceValue including(java.lang.Object value)
           
 SequenceValue includingAll(CollectionValue values)
           
 IntegerValue indexOf(java.lang.Object object)
           
 SequenceValue insertAt(int index, java.lang.Object object)
           
 boolean isOrdered()
           
 boolean isUnique()
           
 java.lang.Object last()
           
 SequenceValue prepend(java.lang.Object object)
           
 SequenceValue prependAll(OrderedCollectionValue objects)
           
 SequenceValue reverse()
           
 SequenceValue sort(java.util.Comparator<java.lang.Object> comparator)
           
 SequenceValue subSequence(int lower, int upper)
          Implementation of the OCL Sequence::subSequence(lower : Integer, upper : Integer) : Sequence(T) operation.
 SequenceValue toSequenceValue()
           
 void toString(java.lang.StringBuilder s, int lengthLimit)
           
 
Methods inherited from class org.eclipse.ocl.examples.domain.values.impl.CollectionValueImpl
asBagValue, asCollection, asCollectionValue, asEcoreObject, asEcoreObject, asEcoreObjects, asObject, asOrderedSetValue, asSetValue, checkElementsAreUnique, count, excludes, excludesAll, flatten, getBagTypeId, getElementTypeId, getObject, getOrderedSetTypeId, getSequenceTypeId, getSetTypeId, getTypeId, hashCode, includes, includesAll, initStatics, intersection, intSize, isEmpty, iterable, iterator, notEmpty, product, size, toString, union
 
Methods inherited from class org.eclipse.ocl.examples.domain.values.impl.ValueImpl
asDouble, asElement, asInteger, asIntegerValue, asNavigableObject, asObjectValue, asRealValue, asTupleValue, asUniqueCollectionValue, asUnlimitedNaturalValue, getTypeName, isInvalid, isUndefined
 
Methods inherited from class org.eclipse.ocl.examples.domain.values.util.ValuesUtil
asBagValue, asBoolean, asCollectionType, asCollectionValue, asInteger, asIntegerValue, asMetaclass, asNavigableObject, asObject, asOrderedCollectionValue, asOrderedSetValue, asRealValue, asSequenceValue, asSetValue, asString, asTupleValue, asType, asUniqueCollectionValue, asUnlimitedNaturalValue, asValue, bigDecimalValueOf, bigIntegerValueOf, characterValueOf, createBagAccumulatorValue, createBagOfEach, createBagRange, createBagValue, createCollectionAccumulatorValue, createInvalidValue, createObjectValue, createOrderedSetAccumulatorValue, createOrderedSetOfEach, createOrderedSetRange, createOrderedSetValue, createRange, createSequenceAccumulatorValue, createSequenceOfEach, createSequenceRange, createSequenceRange, createSequenceValue, createSetAccumulatorValue, createSetOfEach, createSetRange, createSetValue, createTupleOfEach, createTupleValue, createTupleValue, createTypeValue, getEcoreNumber, getTypeName, initAllStatics, integerValueOf, integerValueOf, integerValueOf, integerValueOf, integerValueOf, isBoxed, isCollectionValue, isIntegerNumber, isIntegerValue, isRealNumber, isUnboxed, isUnlimited, oclToString, realValueOf, realValueOf, realValueOf, realValueOf, realValueOf, stringValueOf, throwBooleanInvalidValueException, throwInvalidValueException, 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.CollectionValue
asCollection, asEcoreObject, asEcoreObject, asEcoreObjects, count, excludes, excludesAll, flatten, getTypeId, includes, includesAll, intersection, intSize, isEmpty, iterable, iterator, notEmpty, product, size, union
 
Methods inherited from interface org.eclipse.ocl.examples.domain.values.Value
asBagValue, asCollectionValue, asDouble, asElement, asInteger, asIntegerValue, asNavigableObject, asObject, asObjectValue, asOrderedSetValue, asRealValue, asSetValue, asTupleValue, asUniqueCollectionValue, asUnlimitedNaturalValue, isInvalid, isUndefined
 

Constructor Detail

SequenceValueImpl

public SequenceValueImpl(@NonNull
                         CollectionTypeId typeId,
                         @NonNull
                         java.util.List<? extends java.lang.Object> values)
Method Detail

eStaticClass

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

Overrides:
eStaticClass in class CollectionValueImpl
Generated

append

@NonNull
public OrderedCollectionValue append(@Nullable
                                             java.lang.Object object)
Specified by:
append in interface OrderedCollectionValue

appendAll

@NonNull
public OrderedCollectionValue appendAll(@NonNull
                                                OrderedCollectionValue objects)
Specified by:
appendAll in interface OrderedCollectionValue

asList

@NonNull
public java.util.List<? extends java.lang.Object> asList()
Overrides:
asList in class CollectionValueImpl

asOrderedCollectionValue

@NonNull
public OrderedCollectionValue asOrderedCollectionValue()
Specified by:
asOrderedCollectionValue in interface Value
Overrides:
asOrderedCollectionValue in class ValueImpl

asSequenceValue

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

at

@Nullable
public java.lang.Object at(int index)
Specified by:
at in interface OrderedCollectionValue

equals

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

excluding

@NonNull
public SequenceValue excluding(@Nullable
                                       java.lang.Object value)
Specified by:
excluding in interface CollectionValue

excludingAll

@NonNull
public SequenceValue excludingAll(@NonNull
                                          CollectionValue values)
Specified by:
excludingAll in interface CollectionValue

first

@Nullable
public java.lang.Object first()
Specified by:
first in interface OrderedCollectionValue

flatten

@NonNull
public SequenceValue flatten()
Specified by:
flatten in interface CollectionValue

getElements

@NonNull
public java.util.List<? extends java.lang.Object> getElements()
Specified by:
getElements in interface CollectionValue
Overrides:
getElements in class CollectionValueImpl

getKind

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

including

@NonNull
public SequenceValue including(@Nullable
                                       java.lang.Object value)
Specified by:
including in interface CollectionValue

includingAll

@NonNull
public SequenceValue includingAll(@NonNull
                                          CollectionValue values)
Specified by:
includingAll in interface CollectionValue

indexOf

@NonNull
public IntegerValue indexOf(@Nullable
                                    java.lang.Object object)
Specified by:
indexOf in interface OrderedCollectionValue

insertAt

@NonNull
public SequenceValue insertAt(int index,
                                      @Nullable
                                      java.lang.Object object)
Specified by:
insertAt in interface OrderedCollectionValue

isOrdered

public boolean isOrdered()
Specified by:
isOrdered in interface CollectionValue

isUnique

public boolean isUnique()
Specified by:
isUnique in interface CollectionValue

last

@Nullable
public java.lang.Object last()
Specified by:
last in interface OrderedCollectionValue

prepend

@NonNull
public SequenceValue prepend(@Nullable
                                     java.lang.Object object)
Specified by:
prepend in interface OrderedCollectionValue

prependAll

@NonNull
public SequenceValue prependAll(@NonNull
                                        OrderedCollectionValue objects)
Specified by:
prependAll in interface OrderedCollectionValue

reverse

@NonNull
public SequenceValue reverse()
Specified by:
reverse in interface OrderedCollectionValue

sort

@NonNull
public SequenceValue sort(@NonNull
                                  java.util.Comparator<java.lang.Object> comparator)
Specified by:
sort in interface CollectionValue

subSequence

@NonNull
public SequenceValue subSequence(int lower,
                                         int upper)
Implementation of the OCL Sequence::subSequence(lower : Integer, upper : Integer) : Sequence(T) operation.

Specified by:
subSequence in interface SequenceValue
Parameters:
lower - the 1-based (in OCL fashion) inclusive lower bound
upper - the 1-based (in OCL fashion) inclusive upper bound
Returns:
the source collection with the object inserted at the index
Throws:
java.lang.IndexOutOfBoundsException - if an index is out of bounds
java.lang.IllegalArgumentException - if the lower bound is greater than the upper

toSequenceValue

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

toString

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