org.objectweb.jonas_ejb.container.jorm
Class Collection

java.lang.Object
  extended by org.objectweb.jonas_ejb.container.jorm.GenClassImpl
      extended by org.objectweb.jonas_ejb.container.jorm.Collection
All Implemented Interfaces:
java.lang.Iterable, java.util.Collection, org.objectweb.jorm.api.PAccessor, org.objectweb.jorm.api.PGenClassAccessor, org.objectweb.jorm.api.PIndexedElemFactory

public class Collection
extends GenClassImpl
implements java.util.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.objectweb.jonas_ejb.container.jorm.GenClassImpl
GenClassImpl.ElementIterator
 
Field Summary
 
Fields inherited from class org.objectweb.jonas_ejb.container.jorm.GenClassImpl
deletedLength, ectx, gcm, isModified, listener, pb, pIndexedElems, selectForUpdate, size
 
Constructor Summary
Collection()
           
 
Method Summary
 boolean add(java.lang.Object o)
           
 boolean addAll(java.util.Collection collection)
          It iterates over the collection parameter to add each element in the collection.
 void clear()
          It removes all elements.
 boolean contains(java.lang.Object o)
           
 boolean containsAll(java.util.Collection collection)
           
 org.objectweb.jorm.api.PIndexedElem createPIndexedElem()
          The default implementation of the PIndexedElem is GenClassElement.
 boolean isEmpty()
           
 java.util.Iterator iterator()
           
 boolean remove(java.lang.Object o)
           
 boolean remove(java.lang.Object o, boolean callListener)
           
 boolean removeAll(java.util.Collection collection)
          It iterates over the collection parameter to remove each element in the collection.
 boolean retainAll(java.util.Collection collection)
          For each element of the current collection, it checks if it exist into the collection parameter.
 int size()
           
 java.lang.Object[] toArray()
          It returns an array of the elements.
 java.lang.Object[] toArray(java.lang.Object[] objects)
          It returns an array of the elements.
 
Methods inherited from class org.objectweb.jonas_ejb.container.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 java.util.Collection

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface java.util.Collection

contains

public boolean contains(java.lang.Object o)
Specified by:
contains in interface java.util.Collection

iterator

public java.util.Iterator iterator()
Specified by:
iterator in interface java.lang.Iterable
Specified by:
iterator in interface java.util.Collection

toArray

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

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

toArray

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

Specified by:
toArray in interface java.util.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(java.lang.Object o)
Specified by:
add in interface java.util.Collection

remove

public boolean remove(java.lang.Object o)
Specified by:
remove in interface java.util.Collection

remove

public boolean remove(java.lang.Object o,
                      boolean callListener)

containsAll

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

addAll

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

Specified by:
addAll in interface java.util.Collection

removeAll

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

Specified by:
removeAll in interface java.util.Collection

retainAll

public boolean retainAll(java.util.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 java.util.Collection

clear

public void clear()
It removes all elements.

Specified by:
clear in interface java.util.Collection