org.infolayer.util
Interface OclCollection

All Superinterfaces:
Typed
All Known Implementing Classes:
AbstractOclCollection

public interface OclCollection
extends Typed

immutable(!) collections of objects. Please note that for union the resulting collection type is max(ct1, ct2).


Field Summary
static int BAG
           
static int COLLECTION
          0 is reserved for no collection, see generic type!!
static java.lang.String[] names
           
static int ORDERED_SET
           
static int SEQUENCE
           
static int SET
           
 
Method Summary
 OclCollection append(java.lang.Object o)
           
 OclCollection asBag()
           
 OclCollection asSequence()
           
 OclCollection asSet()
           
 java.lang.Object at(long n)
          Returns the n-th element of the collection.
 OclCollection collectNested(OclExpression expr)
           
 long count(java.lang.Object object)
          The number of times that object occurs in this collection
 OclCollection difference(OclCollection c2)
           
 boolean excludes(java.lang.Object object)
           
 boolean excludesAll(OclCollection collection)
           
 OclCollection excluding(java.lang.Object o)
           
 java.lang.Object first()
           
 OclCollection flatten()
           
 int getCollectionType()
           
 UmlClassifier getElementType()
           
 OclCollection getSealed()
           
 boolean includes(java.lang.Object object)
           
 boolean includesAll(OclCollection collection)
           
 OclCollection including(java.lang.Object o)
           
 long indexOf(java.lang.Object o)
           
 OclCollection insertAt(long index, java.lang.Object o)
           
 OclCollection intersection(OclCollection c2)
           
 boolean isEmpty()
           
 boolean isSealed()
           
 java.util.Iterator iterator()
           
 java.lang.Object last()
           
 java.lang.Object max()
           
 java.lang.Object min()
           
 boolean notEmpty()
           
 OclCollection prepend(java.lang.Object o)
           
 OclCollection reverse()
           
 OclCollection select(int permission)
           
 OclCollection select(OclExpression filter)
           
 long size()
          Returns the number of elements contained in this collection
 OclCollection sortedBy(OclExpression orderBy)
           
 OclCollection subSequence(long lower, long upper)
           
 java.lang.Object sum()
           
 OclCollection symmetricDifference(OclCollection c2)
           
 OclCollection union(OclCollection c2)
           
 
Methods inherited from interface org.infolayer.model.Typed
getType, toOclLiteral
 

Field Detail

COLLECTION

public static final int COLLECTION
0 is reserved for no collection, see generic type!!

See Also:
Constant Field Values

SET

public static final int SET
See Also:
Constant Field Values

BAG

public static final int BAG
See Also:
Constant Field Values

SEQUENCE

public static final int SEQUENCE
See Also:
Constant Field Values

ORDERED_SET

public static final int ORDERED_SET
See Also:
Constant Field Values

names

public static final java.lang.String[] names
Method Detail

getElementType

public UmlClassifier getElementType()

getCollectionType

public int getCollectionType()

iterator

public java.util.Iterator iterator()

size

public long size()
Returns the number of elements contained in this collection


includes

public boolean includes(java.lang.Object object)

excludes

public boolean excludes(java.lang.Object object)

count

public long count(java.lang.Object object)
The number of times that object occurs in this collection


includesAll

public boolean includesAll(OclCollection collection)

excludesAll

public boolean excludesAll(OclCollection collection)

isEmpty

public boolean isEmpty()

notEmpty

public boolean notEmpty()

sum

public java.lang.Object sum()

max

public java.lang.Object max()

min

public java.lang.Object min()

union

public OclCollection union(OclCollection c2)

intersection

public OclCollection intersection(OclCollection c2)

reverse

public OclCollection reverse()

difference

public OclCollection difference(OclCollection c2)

including

public OclCollection including(java.lang.Object o)

excluding

public OclCollection excluding(java.lang.Object o)

symmetricDifference

public OclCollection symmetricDifference(OclCollection c2)

flatten

public OclCollection flatten()

asSet

public OclCollection asSet()

asSequence

public OclCollection asSequence()

asBag

public OclCollection asBag()

append

public OclCollection append(java.lang.Object o)

prepend

public OclCollection prepend(java.lang.Object o)

insertAt

public OclCollection insertAt(long index,
                              java.lang.Object o)

subSequence

public OclCollection subSequence(long lower,
                                 long upper)

at

public java.lang.Object at(long n)
Returns the n-th element of the collection. Please note that counting starts with 1.

Parameters:
n - The index position of the desired element
Returns:
The element at the given index

indexOf

public long indexOf(java.lang.Object o)

first

public java.lang.Object first()

last

public java.lang.Object last()

isSealed

public boolean isSealed()

getSealed

public OclCollection getSealed()

select

public OclCollection select(int permission)

select

public OclCollection select(OclExpression filter)

sortedBy

public OclCollection sortedBy(OclExpression orderBy)

collectNested

public OclCollection collectNested(OclExpression expr)