public abstract class CollectionValueImpl extends ValueImpl implements CollectionValue, java.lang.Iterable<java.lang.Object>
CollectionValue.Accumulator| Modifier and Type | Field and Description |
|---|---|
protected java.util.Collection<? extends java.lang.Object> |
elements |
static org.eclipse.ocl.examples.domain.values.impl.CollectionValueImpl.NullIterator |
EMPTY_ITERATOR |
protected CollectionTypeId |
typeId |
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_VALUEINVALID_NAME| Modifier | Constructor and Description |
|---|---|
protected |
CollectionValueImpl(CollectionTypeId typeId,
java.util.Collection<? extends java.lang.Object> values) |
| Modifier and Type | Method and Description |
|---|---|
BagValue |
asBagValue()
Add a value to a working collection, returning true if the working
collection is changed by the addition.
|
java.util.Collection<? extends java.lang.Object> |
asCollection() |
CollectionValue |
asCollectionValue() |
java.util.List<java.lang.Object> |
asEcoreObject()
Return the Ecore representation of this value.
|
java.util.List<? extends java.lang.Object> |
asList() |
java.lang.Object |
asObject() |
OrderedSetValue |
asOrderedSetValue() |
SequenceValue |
asSequenceValue() |
SetValue |
asSetValue() |
protected boolean |
checkElementsAreUnique(java.lang.Iterable<? extends java.lang.Object> elements) |
IntegerValue |
count(java.lang.Object value)
Implementation of the OCL
Collection::count(object : T) : Integer
operation.
|
protected org.eclipse.emf.ecore.EClass |
eStaticClass() |
java.lang.Boolean |
excludes(java.lang.Object value)
Implementation of the OCL
Collection::excludes(object : T) : Boolean
operation.
|
java.lang.Boolean |
excludesAll(CollectionValue c)
Implementation of the OCL
Collection::excludesAll(c : Collection(T)) : Boolean
operation.
|
boolean |
flatten(java.util.Collection<java.lang.Object> flattenedElements)
Returns true if any element flattened.
|
CollectionTypeId |
getBagTypeId() |
java.util.Collection<? extends java.lang.Object> |
getElements() |
TypeId |
getElementTypeId() |
java.util.Collection<? extends java.lang.Object> |
getObject() |
CollectionTypeId |
getOrderedSetTypeId() |
CollectionTypeId |
getSequenceTypeId() |
CollectionTypeId |
getSetTypeId() |
CollectionTypeId |
getTypeId()
Return the type of this value determined from its construction context.
|
int |
hashCode() |
java.lang.Boolean |
includes(java.lang.Object value) |
java.lang.Boolean |
includesAll(CollectionValue c)
Implementation of the OCL
Collection::includesAll(c : Collection(T)) : Boolean
operation.
|
static void |
initStatics()
A simple public static method that may be used to force class initialization.
|
CollectionValue |
intersection(CollectionValue that) |
int |
intSize() |
java.lang.Boolean |
isEmpty() |
java.lang.Iterable<? extends java.lang.Object> |
iterable() |
java.util.Iterator<java.lang.Object> |
iterator() |
java.lang.Boolean |
notEmpty() |
java.util.Set<TupleValue> |
product(CollectionValue c,
TupleTypeId tupleTypeId) |
IntegerValue |
size() |
java.lang.String |
toString() |
void |
toString(java.lang.StringBuilder s,
int lengthLimit) |
CollectionValue |
union(CollectionValue that) |
asDouble, asElement, asInteger, asIntegerValue, asNavigableObject, asObjectValue, asRealValue, asTupleValue, asUniqueCollectionValue, asUnlimitedNaturalValue, getTypeName, isInvalid, isUndefinedasBagValue, asBoolean, asCollectionType, asCollectionValue, asInteger, asIntegerValue, asNavigableObject, asObject, asOrderedSetValue, asRealValue, asSequenceValue, asSetValue, asString, asTupleValue, asType, asUniqueCollectionValue, asUnlimitedNaturalValue, asValue, 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, getTypeName, initAllStatics, integerValueOf, integerValueOf, integerValueOf, integerValueOf, integerValueOf, isBoxed, isCollectionValue, isIntegerValue, isUnboxed, isUnlimited, oclToString, realValueOf, realValueOf, realValueOf, realValueOf, realValueOf, stringValueOf, throwInvalidValueException, toStringclone, equals, finalize, getClass, notify, notifyAll, wait, wait, waitexcluding, excludingAll, flatten, getKind, including, includingAll, isOrdered, isUnique, sort, toSequenceValueasDouble, asElement, asInteger, asIntegerValue, asNavigableObject, asObjectValue, asRealValue, asTupleValue, asUniqueCollectionValue, asUnlimitedNaturalValue, isInvalid, isUndefined@NonNull public static org.eclipse.ocl.examples.domain.values.impl.CollectionValueImpl.NullIterator EMPTY_ITERATOR
@NonNull protected final CollectionTypeId typeId
@NonNull protected final java.util.Collection<? extends java.lang.Object> elements
protected CollectionValueImpl(@NonNull
CollectionTypeId typeId,
@NonNull
java.util.Collection<? extends java.lang.Object> values)
public static void initStatics()
protected org.eclipse.emf.ecore.EClass eStaticClass()
eStaticClass in class ValueImplprotected boolean checkElementsAreUnique(java.lang.Iterable<? extends java.lang.Object> elements)
@NonNull public BagValue asBagValue()
The default implementation is appropriate for non-unique collections and must be overridden to support OCL rather than Java uniqueness semantics.
asBagValue in interface ValueasBagValue in class ValueImpl@NonNull public java.util.Collection<? extends java.lang.Object> asCollection()
asCollection in interface CollectionValue@NonNull public CollectionValue asCollectionValue()
asCollectionValue in interface ValueasCollectionValue in class ValueImpl@NonNull public java.util.List<java.lang.Object> asEcoreObject()
ValueAn thrown exception for an invalid OCL value.
Java-null for a null OCL value
Objects for other things
asEcoreObject in interface CollectionValueasEcoreObject in interface ValueasEcoreObject in class ValueImpl@NonNull public java.util.List<? extends java.lang.Object> asList()
@NonNull public OrderedSetValue asOrderedSetValue()
asOrderedSetValue in interface ValueasOrderedSetValue in class ValueImpl@NonNull public SequenceValue asSequenceValue()
asSequenceValue in interface ValueasSequenceValue in class ValueImpl@NonNull public SetValue asSetValue()
asSetValue in interface ValueasSetValue in class ValueImpl@NonNull public IntegerValue count(@Nullable java.lang.Object value)
count in interface CollectionValueself - the source collectionobject - an objectInvalidValueException@NonNull
public java.lang.Boolean excludes(@Nullable
java.lang.Object value)
excludes in interface CollectionValueself - the source collectionobject - an object@NonNull
public java.lang.Boolean excludesAll(@NonNull
CollectionValue c)
excludesAll in interface CollectionValueself - the source collectionc - another collectionpublic boolean flatten(@NonNull
java.util.Collection<java.lang.Object> flattenedElements)
flatten in interface CollectionValueInvalidValueException@NonNull public CollectionTypeId getBagTypeId()
@NonNull public TypeId getElementTypeId()
@NonNull public java.util.Collection<? extends java.lang.Object> getElements()
getElements in interface CollectionValue@NonNull public java.util.Collection<? extends java.lang.Object> getObject()
@NonNull public CollectionTypeId getOrderedSetTypeId()
@NonNull public CollectionTypeId getSequenceTypeId()
@NonNull public CollectionTypeId getSetTypeId()
@NonNull public CollectionTypeId getTypeId()
ValuegetTypeId in interface CollectionValuegetTypeId in interface Valuepublic final int hashCode()
hashCode in class java.lang.Object@NonNull
public java.lang.Boolean includes(@Nullable
java.lang.Object value)
includes in interface CollectionValue@NonNull
public java.lang.Boolean includesAll(@NonNull
CollectionValue c)
includesAll in interface CollectionValueself - the source collectionc - another collectionpublic int intSize()
intSize in interface CollectionValue@NonNull public CollectionValue intersection(@NonNull CollectionValue that)
intersection in interface CollectionValue@NonNull public java.lang.Boolean isEmpty()
isEmpty in interface CollectionValue@NonNull public java.lang.Iterable<? extends java.lang.Object> iterable()
iterable in interface CollectionValue@NonNull public java.util.Iterator<java.lang.Object> iterator()
iterator in interface java.lang.Iterable<java.lang.Object>iterator in interface CollectionValue@NonNull public java.lang.Boolean notEmpty()
notEmpty in interface CollectionValue@NonNull public java.util.Set<TupleValue> product(@NonNull CollectionValue c, @NonNull TupleTypeId tupleTypeId)
product in interface CollectionValue@NonNull public IntegerValue size()
size in interface CollectionValuepublic java.lang.String toString()
toString in class java.lang.Objectpublic void toString(@NonNull
java.lang.StringBuilder s,
int lengthLimit)
@NonNull public CollectionValue union(@NonNull CollectionValue that)
union in interface CollectionValue