org.ow2.jonas.lib.ejb21.jorm
Class Collection

java.lang.Object
  extended by org.ow2.jonas.lib.ejb21.jorm.GenClassImpl
      extended by org.ow2.jonas.lib.ejb21.jorm.Collection
All Implemented Interfaces:
Iterable, Collection, org.objectweb.jorm.api.PAccessor, org.objectweb.jorm.api.PGenClassAccessor, org.objectweb.jorm.api.PIndexedElemFactory

public class Collection
extends GenClassImpl
implements Collection

This class is a basic implementation of the java.util.Collection based on the generic class implementation (GenClassImpl). This class can be used to represent a relation between bean.

Author:
S.Chassande-Barrioz : Initial developer, Helene Joanin : fix bugs in the toArray(...) methods

Nested Class Summary
 
Nested classes/interfaces inherited from class org.ow2.jonas.lib.ejb21.jorm.GenClassImpl
GenClassImpl.ElementIterator
 
Field Summary
 
Fields inherited from class org.ow2.jonas.lib.ejb21.jorm.GenClassImpl
deletedLength, ectx, gcm, isModified, listener, pb, pIndexedElems, selectForUpdate, size
 
Constructor Summary
Collection()
           
 
Method Summary
 boolean add(Object o)
           
 boolean addAll(Collection collection)
          It iterates over the collection parameter to add each element in the collection.
 void clear()
          It removes all elements.
 boolean contains(Object o)
           
 boolean containsAll(Collection collection)
           
 org.objectweb.jorm.api.PIndexedElem createPIndexedElem()
          The default implementation of the PIndexedElem is GenClassElement.
 boolean isEmpty()
           
 Iterator iterator()
           
 boolean remove(Object o)
           
 boolean remove(Object o, boolean callListener)
           
 boolean removeAll(Collection collection)
          It iterates over the collection parameter to remove each element in the collection.
 boolean retainAll(Collection collection)
          For each element of the current collection, it checks if it exist into the collection parameter.
 int size()
           
 Object[] toArray()
          It returns an array of the elements.
 Object[] toArray(Object[] objects)
          It returns an array of the elements.
 
Methods inherited from class org.ow2.jonas.lib.ejb21.jorm.GenClassImpl
gcAdd, gcClear, gcContains, gcDeref, gcGetElement, gcGetPBinding, gcGetRealIndex, gcGetSize, gcIsModified, gcIterator, gcIterator, gcObject2ref, gcRemove, getListener, getMemoryInstance, paAdd, paDeltaSupported, paGetNbElem, paIterator, paSetNbElem, printState, read, reset, setEntityContext, setListener, setPBinding, setPClassMapping, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Collection
equals, hashCode
 

Constructor Detail

Collection

public Collection()
Method Detail

createPIndexedElem

public org.objectweb.jorm.api.PIndexedElem createPIndexedElem()
Description copied from class: GenClassImpl
The default implementation of the PIndexedElem is GenClassElement. This method may be redefined for different GenClass implementations.

Specified by:
createPIndexedElem in interface org.objectweb.jorm.api.PIndexedElemFactory
Overrides:
createPIndexedElem in class GenClassImpl

size

public int size()
Specified by:
size in interface Collection

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface Collection

contains

public boolean contains(Object o)
Specified by:
contains in interface Collection

iterator

public Iterator iterator()
Specified by:
iterator in interface Iterable
Specified by:
iterator in interface Collection

toArray

public Object[] toArray()
It returns an array of the elements.

Specified by:
toArray in interface Collection
Returns:
array of the elements

toArray

public Object[] toArray(Object[] objects)
It returns an array of the elements. It is built by an iteration over the existing elements.

Specified by:
toArray in interface Collection
Parameters:
objects - the array into which the elements of this collection are to be stored
Returns:
array of the elements

add

public boolean add(Object o)
Specified by:
add in interface Collection

remove

public boolean remove(Object o)
Specified by:
remove in interface Collection

remove

public boolean remove(Object o,
                      boolean callListener)

containsAll

public boolean containsAll(Collection collection)
Specified by:
containsAll in interface Collection

addAll

public boolean addAll(Collection collection)
It iterates over the collection parameter to add each element in the collection.

Specified by:
addAll in interface Collection

removeAll

public boolean removeAll(Collection collection)
It iterates over the collection parameter to remove each element in the collection.

Specified by:
removeAll in interface Collection

retainAll

public boolean retainAll(Collection collection)
For each element of the current collection, it checks if it exist into the collection parameter. If it does not found then it is removed from the current collection.

Specified by:
retainAll in interface Collection

clear

public void clear()
It removes all elements.

Specified by:
clear in interface Collection


Copyright © 2010 OW2 Consortium. All Rights Reserved.