|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.eclipse.ocl.examples.domain.values.util.ValuesUtil
org.eclipse.ocl.examples.domain.values.impl.ValueImpl
org.eclipse.ocl.examples.domain.values.impl.CollectionValueImpl
public abstract class CollectionValueImpl
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface org.eclipse.ocl.examples.domain.values.CollectionValue |
|---|
CollectionValue.Accumulator |
| Field Summary | |
|---|---|
protected java.util.Collection<? extends java.lang.Object> |
elements
|
static org.eclipse.ocl.examples.domain.values.impl.CollectionValueImpl.NullIterator |
EMPTY_ITERATOR
|
protected CollectionTypeId |
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 | |
|---|---|
protected |
CollectionValueImpl(CollectionTypeId typeId,
java.util.Collection<? extends java.lang.Object> values)
|
| Method Summary | ||
|---|---|---|
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()
Deprecated. |
|
java.util.List<java.lang.Object> |
asEcoreObject(IdResolver idResolver)
|
|
|
asEcoreObjects(IdResolver idResolver,
java.lang.Class<T> elementClass)
|
|
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)
|
|
| Methods inherited from class org.eclipse.ocl.examples.domain.values.impl.ValueImpl |
|---|
asDouble, asElement, asInteger, asIntegerValue, asNavigableObject, asObjectValue, asOrderedCollectionValue, asRealValue, asTupleValue, asUniqueCollectionValue, asUnlimitedNaturalValue, getTypeName, isInvalid, isUndefined |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.eclipse.ocl.examples.domain.values.CollectionValue |
|---|
excluding, excludingAll, flatten, getKind, including, includingAll, isOrdered, isUnique, sort, toSequenceValue |
| Methods inherited from interface org.eclipse.ocl.examples.domain.values.Value |
|---|
asDouble, asElement, asInteger, asIntegerValue, asNavigableObject, asObjectValue, asOrderedCollectionValue, asRealValue, asTupleValue, asUniqueCollectionValue, asUnlimitedNaturalValue, isInvalid, isUndefined |
| Field Detail |
|---|
@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
| Constructor Detail |
|---|
protected CollectionValueImpl(@NonNull
CollectionTypeId typeId,
@NonNull
java.util.Collection<? extends java.lang.Object> values)
| Method Detail |
|---|
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@Deprecated @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<java.lang.Object> asEcoreObject(@NonNull
IdResolver idResolver)
asEcoreObject in interface CollectionValueasEcoreObject in interface ValueasEcoreObject in class ValueImpl
@NonNull
public <T> java.util.List<T> asEcoreObjects(@NonNull
IdResolver idResolver,
@NonNull
java.lang.Class<T> elementClass)
asEcoreObjects in interface CollectionValue@NonNull public java.util.List<? extends java.lang.Object> asList()
@NonNull public java.lang.Object asObject()
asObject in interface Value@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 object
InvalidValueException
@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 collection
public 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()
Value
getTypeId 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 collection
public 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.Object
public void toString(@NonNull
java.lang.StringBuilder s,
int lengthLimit)
toString in interface ValuetoString in class ValueImpl
@NonNull
public CollectionValue union(@NonNull
CollectionValue that)
union in interface CollectionValue
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||