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

java.lang.Object
  extended by org.eclipse.ocl.examples.domain.values.util.ValuesUtil
      extended by org.eclipse.ocl.examples.domain.values.impl.ValueImpl
          extended by org.eclipse.ocl.examples.domain.values.impl.CollectionValueImpl
              extended by org.eclipse.ocl.examples.domain.values.impl.BagValueImpl
All Implemented Interfaces:
java.lang.Iterable<java.lang.Object>, BagValue, CollectionValue, Value
Direct Known Subclasses:
BagValueImpl.Accumulator

public class BagValueImpl
extends CollectionValueImpl
implements BagValue

Generated
NOT

Nested Class Summary
static class BagValueImpl.Accumulator
           
 
Field Summary
 
Fields inherited from class org.eclipse.ocl.examples.domain.values.impl.CollectionValueImpl
elements, EMPTY_ITERATOR, 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
BagValueImpl(CollectionTypeId typeId, Bag<? extends java.lang.Object> boxedValues)
           
 
Method Summary
 BagValue asBagValue()
          Add a value to a working collection, returning true if the working collection is changed by the addition.
static Bag<java.lang.Object> createBagOfEach(java.lang.Object[] boxedValues)
           
 boolean equals(java.lang.Object obj)
           
protected  org.eclipse.emf.ecore.EClass eStaticClass()
           
 BagValue excluding(java.lang.Object value)
           
 BagValue excludingAll(CollectionValue values)
           
 BagValue flatten()
           
 Bag<? extends java.lang.Object> getElements()
           
 java.lang.String getKind()
           
 BagValue including(java.lang.Object value)
           
 BagValue includingAll(CollectionValue values)
           
 boolean isOrdered()
           
 boolean isUnique()
           
 SequenceValue sort(java.util.Comparator<java.lang.Object> comparator)
           
 SequenceValue toSequenceValue()
           
 void toString(java.lang.StringBuilder s, int lengthLimit)
           
 
Methods inherited from class org.eclipse.ocl.examples.domain.values.impl.CollectionValueImpl
asCollection, asCollectionValue, asEcoreObject, asEcoreObject, asEcoreObjects, asList, asObject, asOrderedSetValue, asSequenceValue, asSetValue, checkElementsAreUnique, count, excludes, excludesAll, flatten, getBagTypeId, getElementTypeId, getObject, getOrderedSetTypeId, getSequenceTypeId, getSetTypeId, getTypeId, hashCode, includes, includesAll, initStatics, intersection, intSize, isEmpty, iterable, iterator, notEmpty, product, size, toString, union
 
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 org.eclipse.ocl.examples.domain.values.util.ValuesUtil
asBagValue, asBoolean, asCollectionType, asCollectionValue, asInteger, asIntegerValue, asMetaclass, asNavigableObject, asObject, asOrderedCollectionValue, asOrderedSetValue, asRealValue, asSequenceValue, asSetValue, asString, asTupleValue, asType, asUniqueCollectionValue, asUnlimitedNaturalValue, asValue, bigDecimalValueOf, bigIntegerValueOf, characterValueOf, 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, getEcoreNumber, getTypeName, initAllStatics, integerValueOf, integerValueOf, integerValueOf, integerValueOf, integerValueOf, isBoxed, isCollectionValue, isIntegerNumber, isIntegerValue, isRealNumber, isUnboxed, isUnlimited, oclToString, realValueOf, realValueOf, realValueOf, realValueOf, realValueOf, stringValueOf, throwBooleanInvalidValueException, throwInvalidValueException, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.eclipse.ocl.examples.domain.values.CollectionValue
asCollection, asEcoreObject, asEcoreObject, asEcoreObjects, count, excludes, excludesAll, flatten, getTypeId, includes, includesAll, intersection, intSize, isEmpty, iterable, iterator, notEmpty, product, size, union
 
Methods inherited from interface org.eclipse.ocl.examples.domain.values.Value
asCollectionValue, asDouble, asElement, asInteger, asIntegerValue, asNavigableObject, asObject, asObjectValue, asOrderedCollectionValue, asOrderedSetValue, asRealValue, asSequenceValue, asSetValue, asTupleValue, asUniqueCollectionValue, asUnlimitedNaturalValue, isInvalid, isUndefined
 

Constructor Detail

BagValueImpl

public BagValueImpl(@NonNull
                    CollectionTypeId typeId,
                    @NonNull
                    Bag<? extends java.lang.Object> boxedValues)
Method Detail

eStaticClass

protected org.eclipse.emf.ecore.EClass eStaticClass()

Overrides:
eStaticClass in class CollectionValueImpl
Generated

createBagOfEach

@NonNull
public static Bag<java.lang.Object> createBagOfEach(@NonNull
                                                            java.lang.Object[] boxedValues)

asBagValue

@NonNull
public BagValue asBagValue()
Description copied from class: CollectionValueImpl
Add a value to a working collection, returning true if the working collection is changed by the addition.

The default implementation is appropriate for non-unique collections and must be overridden to support OCL rather than Java uniqueness semantics.

Specified by:
asBagValue in interface Value
Overrides:
asBagValue in class CollectionValueImpl

equals

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

excluding

@NonNull
public BagValue excluding(@Nullable
                                  java.lang.Object value)
Specified by:
excluding in interface CollectionValue

excludingAll

@NonNull
public BagValue excludingAll(@NonNull
                                     CollectionValue values)
Specified by:
excludingAll in interface CollectionValue

flatten

@NonNull
public BagValue flatten()
Specified by:
flatten in interface CollectionValue

getElements

@NonNull
public Bag<? extends java.lang.Object> getElements()
Specified by:
getElements in interface CollectionValue
Overrides:
getElements in class CollectionValueImpl

getKind

@NonNull
public java.lang.String getKind()
Specified by:
getKind in interface CollectionValue

including

@NonNull
public BagValue including(@Nullable
                                  java.lang.Object value)
Specified by:
including in interface CollectionValue

includingAll

@NonNull
public BagValue includingAll(@NonNull
                                     CollectionValue values)
Specified by:
includingAll in interface CollectionValue

isOrdered

public boolean isOrdered()
Specified by:
isOrdered in interface CollectionValue

isUnique

public boolean isUnique()
Specified by:
isUnique in interface CollectionValue

sort

@NonNull
public SequenceValue sort(@NonNull
                                  java.util.Comparator<java.lang.Object> comparator)
Specified by:
sort in interface CollectionValue

toSequenceValue

@NonNull
public SequenceValue toSequenceValue()
Specified by:
toSequenceValue in interface CollectionValue

toString

public void toString(@NonNull
                     java.lang.StringBuilder s,
                     int lengthLimit)
Specified by:
toString in interface Value
Overrides:
toString in class CollectionValueImpl