org.infolayer.util
Class DefaultOclCollection

java.lang.Object
  extended byorg.infolayer.util.AbstractOclCollection
      extended byorg.infolayer.util.DefaultOclCollection
All Implemented Interfaces:
OclCollection, Typed

public class DefaultOclCollection
extends AbstractOclCollection

Vector based default OclCollection implementation. Note that OclCollection can't be changed after creation, so the contents have to be passed to the constructor.


Field Summary
 
Fields inherited from interface org.infolayer.util.OclCollection
BAG, COLLECTION, names, ORDERED_SET, SEQUENCE, SET
 
Constructor Summary
DefaultOclCollection(int collectionType, UmlClassifier elementType)
           
DefaultOclCollection(int collectionType, UmlClassifier elementType, java.util.Collection v, boolean sealed)
          please note: the collection is not copied, it is taken as it is.
DefaultOclCollection(int collectionType, UmlClassifier elementType, java.util.Iterator iter)
           
DefaultOclCollection(int collectionType, UmlClassifier elementType, java.util.Iterator iter, OclExpression filter, OclExpression orderBy)
           
 
Method Summary
 java.lang.Object at(long i)
          Returns the n-th element of the collection.
 long count(java.lang.Object object)
          The number of times that object occurs in this collection
 java.util.Collection getCollection()
          Returns the underlying java collection, if not sealed
 java.util.Iterator iterator()
           
 void seal()
           
 long size()
          Returns the number of elements contained in this collection
 
Methods inherited from class org.infolayer.util.AbstractOclCollection
append, asBag, asSequence, asSet, collectNested, difference, equals, excludes, excludesAll, excluding, first, flatten, getCollectionType, getElementType, getSealed, getType, includes, includesAll, including, indexOf, insertAt, intersection, isEmpty, isSealed, last, max, min, notEmpty, prepend, reverse, select, select, sortedBy, subSequence, sum, symmetricDifference, toOclLiteral, toString, union
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DefaultOclCollection

public DefaultOclCollection(int collectionType,
                            UmlClassifier elementType)

DefaultOclCollection

public DefaultOclCollection(int collectionType,
                            UmlClassifier elementType,
                            java.util.Iterator iter)

DefaultOclCollection

public DefaultOclCollection(int collectionType,
                            UmlClassifier elementType,
                            java.util.Iterator iter,
                            OclExpression filter,
                            OclExpression orderBy)

DefaultOclCollection

public DefaultOclCollection(int collectionType,
                            UmlClassifier elementType,
                            java.util.Collection v,
                            boolean sealed)
please note: the collection is not copied, it is taken as it is. If the sealed parameter is set to true,

Method Detail

size

public long size()
Description copied from interface: OclCollection
Returns the number of elements contained in this collection

Specified by:
size in interface OclCollection
Overrides:
size in class AbstractOclCollection

seal

public void seal()

count

public long count(java.lang.Object object)
Description copied from interface: OclCollection
The number of times that object occurs in this collection

Specified by:
count in interface OclCollection
Overrides:
count in class AbstractOclCollection

at

public java.lang.Object at(long i)
Description copied from interface: OclCollection
Returns the n-th element of the collection. Please note that counting starts with 1.

Specified by:
at in interface OclCollection
Overrides:
at in class AbstractOclCollection

getCollection

public java.util.Collection getCollection()
Returns the underlying java collection, if not sealed


iterator

public java.util.Iterator iterator()
Specified by:
iterator in interface OclCollection
Specified by:
iterator in class AbstractOclCollection