org.eclipse.ocl.examples.pivot.values.impl
Class BagValueImpl

java.lang.Object
  extended by org.eclipse.ocl.examples.pivot.values.impl.AbstractValue
      extended by org.eclipse.ocl.examples.pivot.values.impl.AbstractedCollectionValue
          extended by org.eclipse.ocl.examples.pivot.values.impl.AbstractCollectionValue<Bag<Value>>
              extended by org.eclipse.ocl.examples.pivot.values.impl.BagValueImpl
All Implemented Interfaces:
java.lang.Iterable<Value>, BagValue, CollectionValue, NonOrderedCollectionValue, NonUniqueCollectionValue, Value
Direct Known Subclasses:
BagValueImpl.Accumulator

public class BagValueImpl
extends AbstractCollectionValue<Bag<Value>>
implements BagValue


Nested Class Summary
static class BagValueImpl.Accumulator
           
 
Nested classes/interfaces inherited from interface org.eclipse.ocl.examples.pivot.values.Value
Value.BinaryOperation
 
Field Summary
 
Fields inherited from class org.eclipse.ocl.examples.pivot.values.impl.AbstractCollectionValue
elements
 
Fields inherited from class org.eclipse.ocl.examples.pivot.values.impl.AbstractValue
valueFactory
 
Fields inherited from interface org.eclipse.ocl.examples.pivot.values.Value
INVALID_NAME
 
Constructor Summary
BagValueImpl(ValueFactory valueFactory, Bag<Value> elements)
           
BagValueImpl(ValueFactory valueFactory, java.util.Collection<? extends Value> elements)
           
BagValueImpl(ValueFactory valueFactory, Value... elements)
           
 
Method Summary
 BagValue asBagValue()
           
 boolean equals(java.lang.Object obj)
           
 BagValue excluding(Value value)
           
 BagValue flatten()
           
 CollectionKind getKind()
           
 Type getType(TypeManager typeManager, Type staticType)
           
 BagValue including(Value value)
           
static BagValue intersection(ValueFactory valueFactory, CollectionValue left, CollectionValue right)
           
 SequenceValue sort(java.util.Comparator<Value> comparator)
           
 OrderedCollectionValue toOrderedCollectionValue()
           
 void toString(java.lang.StringBuffer s, int lengthLimit)
           
static BagValue union(ValueFactory valueFactory, CollectionValue left, CollectionValue right)
           
 
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
asCollection, asCollectionValue, asList, asObject, asOrderedSetValue, asSequenceValue, 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, 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, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.eclipse.ocl.examples.pivot.values.CollectionValue
asCollection, asList, 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
asBoolean, asBooleanValue, asCollectionValue, asDouble, asElement, asElementValue, asInteger, asIntegerValue, asObject, asObjectValue, asOrderedCollectionValue, asOrderedSetValue, asRealValue, asSequenceValue, asSetValue, asString, asStringValue, asTypeValue, asUniqueCollectionValue, asValidValue, getValueFactory, isCollectionValue, isFalse, isIntegerValue, isInvalid, isNull, isRealValue, isTrue, isUndefined, isUnlimited, isUnlimitedNatural, oclToString, toIntegerValue, toRealValue
 

Constructor Detail

BagValueImpl

public BagValueImpl(ValueFactory valueFactory,
                    Value... elements)

BagValueImpl

public BagValueImpl(ValueFactory valueFactory,
                    java.util.Collection<? extends Value> elements)

BagValueImpl

public BagValueImpl(ValueFactory valueFactory,
                    Bag<Value> elements)
Method Detail

intersection

public static BagValue intersection(ValueFactory valueFactory,
                                    CollectionValue left,
                                    CollectionValue right)
                             throws InvalidValueException
Throws:
InvalidValueException

union

public static BagValue union(ValueFactory valueFactory,
                             CollectionValue left,
                             CollectionValue right)
                      throws InvalidValueException
Throws:
InvalidValueException

asBagValue

public BagValue asBagValue()
Specified by:
asBagValue in interface Value
Overrides:
asBagValue in class AbstractedCollectionValue

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

excluding

public BagValue excluding(Value value)
Specified by:
excluding in interface CollectionValue

flatten

public BagValue flatten()
                 throws InvalidValueException
Specified by:
flatten in interface CollectionValue
Throws:
InvalidValueException

getKind

public CollectionKind getKind()
Specified by:
getKind in interface CollectionValue

getType

public Type getType(TypeManager typeManager,
                    Type staticType)
Specified by:
getType in interface Value

including

public BagValue including(Value value)
                   throws InvalidValueException
Specified by:
including in interface CollectionValue
Throws:
InvalidValueException

sort

public SequenceValue sort(java.util.Comparator<Value> comparator)
Specified by:
sort in interface CollectionValue

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