org.caleigo.core
Class EntityPool

java.lang.Object
  extended byorg.caleigo.core.EntityPool
All Implemented Interfaces:
IEntityPool, java.io.Serializable

public class EntityPool
extends java.lang.Object
implements IEntityPool

EntityPool is the standard implementation of the IEntityPool interface. This entity collection class can store zero or more IEntity objects. The entities stored are not type specified and does not have to be defined by a single IEntityDescriptor. IEntityPool is not ordered and not accept EntityPool duplicates effectively makeing it at a "Set".

Version:
1.00
Author:
Dennis Zikovic
See Also:
Serialized Form

Nested Class Summary
protected  class EntityPool.EntityPoolSet
           
 
Constructor Summary
EntityPool()
           
EntityPool(IEntityPool entityPool)
           
 
Method Summary
 boolean addEntity(IEntity entity)
           
 java.util.Set asSet()
           
 void clear()
           
 boolean contains(IEntity entity)
           
 void deleteAll()
          Deletes all contained entities.
 boolean doesAccept(IEntity entity)
           
 boolean isDirty()
          Return true if any (one or more) of the collections's contained entities has the DIRTY flag set to true that is have unsaved changes.
 boolean isEmpty()
           
 java.util.Iterator iterator()
           
 void refreshAll()
          Performs a refresh on all contained entities.
 boolean removeEntity(IEntity entity)
           
 int size()
           
 void storeAll()
          Stores all contained entities that have the DIRTY flag set to true.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EntityPool

public EntityPool()

EntityPool

public EntityPool(IEntityPool entityPool)
Method Detail

isDirty

public boolean isDirty()
Return true if any (one or more) of the collections's contained entities has the DIRTY flag set to true that is have unsaved changes.

Specified by:
isDirty in interface IEntityPool

storeAll

public void storeAll()
Stores all contained entities that have the DIRTY flag set to true. The entities are stored in a single transaction meaning that if one store fails then all fails.

Specified by:
storeAll in interface IEntityPool

deleteAll

public void deleteAll()
Deletes all contained entities. The entities are deleted in a single transaction meaning that if one delete fails then all fails. USE THIS METHOD WITH CAUTION!

Specified by:
deleteAll in interface IEntityPool

refreshAll

public void refreshAll()
Performs a refresh on all contained entities. The refresh is batched to save performance.

Specified by:
refreshAll in interface IEntityPool

addEntity

public boolean addEntity(IEntity entity)
Specified by:
addEntity in interface IEntityPool

removeEntity

public boolean removeEntity(IEntity entity)
Specified by:
removeEntity in interface IEntityPool

iterator

public java.util.Iterator iterator()
Specified by:
iterator in interface IEntityPool

clear

public void clear()
Specified by:
clear in interface IEntityPool

size

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

isEmpty

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

contains

public boolean contains(IEntity entity)
Specified by:
contains in interface IEntityPool

doesAccept

public boolean doesAccept(IEntity entity)
Specified by:
doesAccept in interface IEntityPool

asSet

public java.util.Set asSet()
Specified by:
asSet in interface IEntityPool


Copyright © 2005 Caleigo. All Rights Reserved.