org.eclipse.ocl.examples.pivot.values.impl
Class AbstractCollectionValue<C extends java.util.Collection<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<C>
- All Implemented Interfaces:
- java.lang.Iterable<Value>, CollectionValue, Value
- Direct Known Subclasses:
- AbstractSequenceValue, BagValueImpl, OrderedSetValueImpl, SetValueImpl
public abstract class AbstractCollectionValue<C extends java.util.Collection<Value>>
- extends AbstractedCollectionValue
Fields inherited from interface org.eclipse.ocl.examples.pivot.values.Value |
INVALID_NAME |
Methods inherited from class org.eclipse.ocl.examples.pivot.values.impl.AbstractedCollectionValue |
asBagValue, asCollection, asCollectionValue, asList, asObject, asOrderedSetValue, asSequenceValue, asSetValue, asValidValue, isCollectionValue, isEmpty, notEmpty, size, toString, toString |
Methods inherited from class org.eclipse.ocl.examples.pivot.values.impl.AbstractValue |
asBoolean, asBooleanValue, asDouble, asElement, asElementValue, asInteger, asIntegerValue, asObjectValue, asOrderedCollectionValue, 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, equals, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.eclipse.ocl.examples.pivot.values.Value |
asBoolean, asBooleanValue, asDouble, asElement, asElementValue, asInteger, asIntegerValue, asObjectValue, asOrderedCollectionValue, asRealValue, asString, asStringValue, asTypeValue, asUniqueCollectionValue, getType, getValueFactory, isFalse, isIntegerValue, isInvalid, isNull, isRealValue, isTrue, isUndefined, isUnlimited, isUnlimitedNatural, oclToString, toIntegerValue, toRealValue |
elements
protected final C extends java.util.Collection<Value> elements
AbstractCollectionValue
protected AbstractCollectionValue(ValueFactory valueFactory,
C elements)
count
public IntegerValue count(Value value)
throws InvalidValueException
- Implementation of the OCL
Collection::count(object : T) : Integer
operation.
- Parameters:
self
- the source collectionobject
- an object
- Returns:
- the number of occurrences of the object in the collection
- Throws:
InvalidValueException
excludes
public BooleanValue excludes(Value value)
- Implementation of the OCL
Collection::excludes(object : T) : Boolean
operation.
- Parameters:
self
- the source collectionobject
- an object
- Returns:
- whether the collection does not include the object
excludesAll
public BooleanValue excludesAll(CollectionValue c)
- Implementation of the OCL
Collection::excludesAll(c : Collection(T)) : Boolean
operation.
- Parameters:
self
- the source collectionc
- another collection
- Returns:
- whether the source collection does not contain any of the
elements of the other
flatten
public boolean flatten(java.util.Collection<Value> flattenedElements)
throws InvalidValueException
- Returns true if any element flattened.
- Throws:
InvalidValueException
getElements
protected java.util.Collection<Value> getElements()
- Specified by:
getElements
in class AbstractedCollectionValue
hashCode
public int hashCode()
- Overrides:
hashCode
in class java.lang.Object
includes
public BooleanValue includes(Value value)
includesAll
public BooleanValue includesAll(CollectionValue c)
- Implementation of the OCL
Collection::includesAll(c : Collection(T)) : Boolean
operation.
- Parameters:
self
- the source collectionc
- another collection
- Returns:
- whether the source collection includes all of the elements
of the other
intSize
public int intSize()
intersection
public CollectionValue intersection(CollectionValue c)
throws InvalidValueException
- Throws:
InvalidValueException
iterator
public java.util.Iterator<Value> iterator()
maxMin
public Value maxMin(Value.BinaryOperation binaryOperation)
throws InvalidValueException
- Throws:
InvalidValueException
product
public java.util.Set<TupleValue> product(CollectionValue c,
TupleType tupleType)
sum
public Value sum(Value.BinaryOperation binaryOperation,
Value zero)
throws InvalidValueException
- Throws:
InvalidValueException
union
public CollectionValue union(CollectionValue c)
throws InvalidValueException
- Throws:
InvalidValueException