org.eclipse.ocl.examples.pivot.values.impl
Class AbstractSequenceValue<L extends java.util.List<Value>>
java.lang.Object
org.eclipse.ocl.examples.pivot.values.impl.AbstractValue
org.eclipse.ocl.examples.pivot.values.impl.AbstractedCollectionValue
org.eclipse.ocl.examples.pivot.values.impl.AbstractCollectionValue<L>
org.eclipse.ocl.examples.pivot.values.impl.AbstractSequenceValue<L>
- All Implemented Interfaces:
- java.lang.Iterable<Value>, CollectionValue, NonUniqueCollectionValue, OrderedCollectionValue, SequenceValue, Value
- Direct Known Subclasses:
- IntegerRangeValueImpl, SequenceValueImpl
public abstract class AbstractSequenceValue<L extends java.util.List<Value>>
- extends AbstractCollectionValue<L>
- implements SequenceValue
Fields inherited from interface org.eclipse.ocl.examples.pivot.values.Value |
INVALID_NAME |
Methods inherited from class org.eclipse.ocl.examples.pivot.values.impl.AbstractCollectionValue |
count, excludes, excludesAll, flatten, getElements, hashCode, includes, includesAll, intersection, intSize, iterator, maxMin, product, sum, union |
Methods inherited from class org.eclipse.ocl.examples.pivot.values.impl.AbstractedCollectionValue |
asBagValue, asCollection, asCollectionValue, asObject, asOrderedSetValue, asSetValue, asValidValue, isCollectionValue, isEmpty, notEmpty, size, toString |
Methods inherited from class org.eclipse.ocl.examples.pivot.values.impl.AbstractValue |
asBoolean, asBooleanValue, asDouble, asElement, asElementValue, asInteger, asIntegerValue, asObjectValue, asRealValue, asString, asStringValue, asTypeValue, asUniqueCollectionValue, getValueFactory, isFalse, isIntegerValue, isInvalid, isNull, isRealValue, isTrue, isUndefined, isUnlimited, isUnlimitedNatural, oclToString, toIntegerValue, toRealValue |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.eclipse.ocl.examples.pivot.values.CollectionValue |
asCollection, count, excludes, excludesAll, flatten, includes, includesAll, intersection, intSize, isEmpty, iterator, maxMin, notEmpty, product, size, sum, union |
Methods inherited from interface org.eclipse.ocl.examples.pivot.values.Value |
asBagValue, asBoolean, asBooleanValue, asCollectionValue, asDouble, asElement, asElementValue, asInteger, asIntegerValue, asObject, asObjectValue, asOrderedSetValue, asRealValue, asSetValue, asString, asStringValue, asTypeValue, asUniqueCollectionValue, asValidValue, getType, getValueFactory, isCollectionValue, isFalse, isIntegerValue, isInvalid, isNull, isRealValue, isTrue, isUndefined, isUnlimited, isUnlimitedNatural, oclToString, toIntegerValue, toRealValue |
AbstractSequenceValue
public AbstractSequenceValue(ValueFactory valueFactory,
L elements)
asList
public java.util.List<Value> asList()
- Specified by:
asList
in interface CollectionValue
- Overrides:
asList
in class AbstractedCollectionValue
asOrderedCollectionValue
public OrderedCollectionValue asOrderedCollectionValue()
- Specified by:
asOrderedCollectionValue
in interface Value
- Overrides:
asOrderedCollectionValue
in class AbstractValue
asSequenceValue
public SequenceValue asSequenceValue()
- Specified by:
asSequenceValue
in interface Value
- Overrides:
asSequenceValue
in class AbstractedCollectionValue
append
public SequenceValue append(Value object)
throws InvalidValueException
- Specified by:
append
in interface OrderedCollectionValue
- Throws:
InvalidValueException
at
public Value at(int index)
throws InvalidValueException
- Specified by:
at
in interface OrderedCollectionValue
- Throws:
InvalidValueException
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in class java.lang.Object
excluding
public SequenceValue excluding(Value value)
- Specified by:
excluding
in interface CollectionValue
first
public Value first()
throws InvalidValueException
- Specified by:
first
in interface OrderedCollectionValue
- Throws:
InvalidValueException
flatten
public SequenceValue flatten()
throws InvalidValueException
- Specified by:
flatten
in interface CollectionValue
- Throws:
InvalidValueException
getKind
public CollectionKind getKind()
- Specified by:
getKind
in interface CollectionValue
including
public SequenceValue 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 OrderedCollectionValue
- Throws:
InvalidValueException
insertAt
public SequenceValue insertAt(int index,
Value object)
throws InvalidValueException
- Specified by:
insertAt
in interface OrderedCollectionValue
- Throws:
InvalidValueException
last
public Value last()
throws InvalidValueException
- Specified by:
last
in interface OrderedCollectionValue
- Throws:
InvalidValueException
prepend
public SequenceValue prepend(Value object)
throws InvalidValueException
- Specified by:
prepend
in interface OrderedCollectionValue
- Throws:
InvalidValueException
reverse
public SequenceValue reverse()
- Specified by:
reverse
in interface OrderedCollectionValue
sort
public SequenceValue sort(java.util.Comparator<Value> comparator)
- Specified by:
sort
in interface CollectionValue
subSequence
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:
self
- the source sequencelower
- the 1-based (in OCL fashion) inclusive lower boundupper
- 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
toOrderedCollectionValue
public OrderedCollectionValue toOrderedCollectionValue()
- Specified by:
toOrderedCollectionValue
in interface CollectionValue
toString
public void toString(java.lang.StringBuffer s,
int lengthLimit)
- Specified by:
toString
in interface Value
- Overrides:
toString
in class AbstractedCollectionValue