public abstract class CollectionValueImpl extends ValueImpl implements CollectionValue, Iterable<Object>
CollectionValue.Accumulator
Modifier and Type | Field and Description |
---|---|
static org.eclipse.ocl.pivot.internal.values.CollectionValueImpl.NullIterator |
EMPTY_ITERATOR |
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_ONE_VALUE, UNLIMITED_VALUE, ZERO_VALUE
INVALID_NAME
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.
|
Collection<? extends Object> |
asCollection() |
CollectionValue |
asCollectionValue() |
List<Object> |
asEcoreObject(IdResolver idResolver,
Class<?> instanceClass)
Return the Ecore representation of this value, which should be fully compatible with the Ecore return
from a similarly typed eGet().
|
<T> List<T> |
asEcoreObjects(IdResolver idResolver,
Class<T> instanceClass) |
List<? extends Object> |
asList() |
Object |
asObject() |
OrderedSetValue |
asOrderedSetValue() |
SequenceValue |
asSequenceValue() |
SetValue |
asSetValue() |
IntegerValue |
count(Object value)
Implementation of the OCL
Collection::count(object : T) : Integer
operation.
|
Boolean |
excludes(Object value)
Implementation of the OCL
Collection::excludes(object : T) : Boolean
operation.
|
Boolean |
excludesAll(CollectionValue c)
Implementation of the OCL
Collection::excludesAll(c : Collection(T)) : Boolean
operation.
|
boolean |
flatten(Collection<Object> flattenedElements)
Returns true if any element flattened.
|
CollectionTypeId |
getBagTypeId() |
Collection<? extends Object> |
getElements() |
TypeId |
getElementTypeId() |
Collection<? extends Object> |
getObject() |
CollectionTypeId |
getOrderedSetTypeId() |
CollectionTypeId |
getSequenceTypeId() |
CollectionTypeId |
getSetTypeId() |
CollectionTypeId |
getTypeId()
Return the type of this value determined from its construction context.
|
int |
hashCode() |
Boolean |
includes(Object value) |
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() |
Boolean |
isEmpty() |
Iterable<? extends Object> |
iterable() |
Iterator<Object> |
iterator() |
Boolean |
notEmpty() |
Set<TupleValue> |
product(CollectionValue c,
TupleTypeId tupleTypeId) |
IntegerValue |
size() |
String |
toString() |
void |
toString(StringBuilder s,
int lengthLimit) |
CollectionValue |
union(CollectionValue that) |
asDouble, asElement, asInteger, asIntegerValue, asMapValue, asNavigableObject, asObjectValue, asOrderedCollectionValue, asRealValue, asTupleValue, asUnboxedObject, asUniqueCollectionValue, asUnlimitedNaturalValue, getTypeName, isInvalid, isUndefined
asBagValue, asBoolean, asClass, asCollectionType, asCollectionValue, asInteger, asIntegerValue, asMapType, asMapValue, asNavigableObject, asNavigableObject, asObject, asOrderedCollectionValue, asOrderedSetValue, asRealValue, asSequenceValue, asSetValue, asString, asTupleValue, asType, asUniqueCollectionValue, asUnlimitedNaturalValue, asValue, bigDecimalValueOf, bigIntegerValueOf, byteValueOf, characterValueOf, computeCollectionHashCode, createBagAccumulatorValue, createBagOfEach, createBagRange, createBagValue, createCollectionAccumulatorValue, createInvalidValue, createMapEntry, createMapOfEach, createMapValue, createObjectValue, createOrderedSetAccumulatorValue, createOrderedSetOfEach, createOrderedSetRange, createOrderedSetValue, createRange, createSequenceAccumulatorValue, createSequenceOfEach, createSequenceRange, createSequenceRange, createSequenceValue, createSetAccumulatorValue, createSetOfEach, createSetRange, createSetValue, createTupleOfEach, createTupleValue, doubleValueOf, floatValueOf, getElementIdName, getExecutor, getTypeName, initAllStatics, integerValueOf, integerValueOf, integerValueOf, integerValueOf, integerValueOf, intValueOf, isBoxed, isCollectionValue, isEcore, isIntegerNumber, isIntegerValue, isRealNumber, isUnboxed, isUnlimited, longValueOf, numberValueOf, oclToString, realValueOf, realValueOf, realValueOf, realValueOf, realValueOf, shortValueOf, stringValueOf, throwBooleanInvalidValueException, throwInvalidValueException, throwUnsupportedCompareTo, toString, typedIterable, unlimitedNaturalValueOf, unlimitedNaturalValueOf, unlimitedNaturalValueOf, unlimitedNaturalValueOf, unlimitedNaturalValueOf
excluding, excludingAll, flatten, getKind, including, includingAll, isOrdered, isUnique, sort, toSequenceValue
asDouble, asElement, asInteger, asIntegerValue, asMapValue, asNavigableObject, asObjectValue, asOrderedCollectionValue, asRealValue, asTupleValue, asUnboxedObject, asUniqueCollectionValue, asUnlimitedNaturalValue, isInvalid, isUndefined
forEach, spliterator
public static org.eclipse.ocl.pivot.internal.values.CollectionValueImpl.NullIterator EMPTY_ITERATOR
public static void initStatics()
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 Value
asBagValue
in class ValueImpl
public Collection<? extends Object> asCollection()
asCollection
in interface CollectionValue
public CollectionValue asCollectionValue()
asCollectionValue
in interface Value
asCollectionValue
in class ValueImpl
public List<Object> asEcoreObject(IdResolver idResolver, Class<?> instanceClass)
Value
A thrown exception for an invalid OCL value.
Java-null for a null OCL value
Objects for other things, List<?> for collections
asEcoreObject
in interface CollectionValue
asEcoreObject
in interface Value
asEcoreObject
in class ValueImpl
public <T> List<T> asEcoreObjects(IdResolver idResolver, Class<T> instanceClass)
asEcoreObjects
in interface CollectionValue
public OrderedSetValue asOrderedSetValue()
asOrderedSetValue
in interface Value
asOrderedSetValue
in class ValueImpl
public SequenceValue asSequenceValue()
asSequenceValue
in interface Value
asSequenceValue
in class ValueImpl
public SetValue asSetValue()
asSetValue
in interface Value
asSetValue
in class ValueImpl
public IntegerValue count(Object value)
count
in interface CollectionValue
value
- an objectInvalidValueException
public Boolean excludes(Object value)
excludes
in interface CollectionValue
value
- an objectpublic Boolean excludesAll(CollectionValue c)
excludesAll
in interface CollectionValue
c
- another collectionpublic boolean flatten(Collection<Object> flattenedElements)
flatten
in interface CollectionValue
InvalidValueException
public CollectionTypeId getBagTypeId()
public TypeId getElementTypeId()
public Collection<? extends Object> getElements()
getElements
in interface CollectionValue
public Collection<? extends Object> getObject()
public CollectionTypeId getOrderedSetTypeId()
public CollectionTypeId getSequenceTypeId()
public CollectionTypeId getSetTypeId()
public CollectionTypeId getTypeId()
Value
getTypeId
in interface CollectionValue
getTypeId
in interface Value
public Boolean includes(Object value)
includes
in interface CollectionValue
public Boolean includesAll(CollectionValue c)
includesAll
in interface CollectionValue
c
- another collectionpublic int intSize()
intSize
in interface CollectionValue
public CollectionValue intersection(CollectionValue that)
intersection
in interface CollectionValue
public Boolean isEmpty()
isEmpty
in interface CollectionValue
public Iterable<? extends Object> iterable()
iterable
in interface CollectionValue
public Iterator<Object> iterator()
iterator
in interface Iterable<Object>
iterator
in interface CollectionValue
public Boolean notEmpty()
notEmpty
in interface CollectionValue
public Set<TupleValue> product(CollectionValue c, TupleTypeId tupleTypeId)
product
in interface CollectionValue
public IntegerValue size()
size
in interface CollectionValue
public void toString(StringBuilder s, int lengthLimit)
public CollectionValue union(CollectionValue that)
union
in interface CollectionValue
Copyright © 2005, 2018 IBM Corporation and others. All Rights Reserved.