org.objectweb.jonas_ejb.container.jorm
Class Collection

java.lang.Object
  |
  +--org.objectweb.jonas_ejb.container.jorm.GenClassImpl
        |
        +--org.objectweb.jonas_ejb.container.jorm.Collection
All Implemented Interfaces:
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

Inner classes inherited from class org.objectweb.jonas_ejb.container.jorm.GenClassImpl
GenClassImpl.ElementIterator
 
Fields inherited from class org.objectweb.jonas_ejb.container.jorm.GenClassImpl
deletedLength, gcm, isModified, listener, pb, pIndexedElems, size
 
Constructor Summary
Collection()
           
Collection(org.objectweb.jorm.api.PClassMapping gcm)
           
 
Method Summary
 boolean add(java.lang.Object o)
           
 boolean add(java.lang.Object o, boolean isMaster, boolean callListener)
           
 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 isMaster, 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)
           
 
Methods inherited from class org.objectweb.jonas_ejb.container.jorm.GenClassImpl
doNotWrite, gcAdd, gcClear, gcContains, gcDeref, gcGetElement, gcGetPBinding, gcGetRealIndex, gcGetSize, gcIsModified, gcIterator, gcIterator, gcObject2ref, gcRemove, getListener, getMemoryInstance, paAdd, paDeltaSupported, paGetNbElem, paIterator, paSetNbElem, printState, read, reset, 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(org.objectweb.jorm.api.PClassMapping gcm)

Collection

public Collection()
Method Detail

createPIndexedElem

public org.objectweb.jorm.api.PIndexedElem createPIndexedElem()
The default implementation of the PIndexedElem is GenClassElement.
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.util.Collection

toArray

public java.lang.Object[] toArray()
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

toArray

public java.lang.Object[] toArray(java.lang.Object[] objects)
Specified by:
toArray in interface java.util.Collection

add

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

add

public boolean add(java.lang.Object o,
                   boolean isMaster,
                   boolean callListener)

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 isMaster,
                      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