|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.caleigo.core.Selection
Selection is an entity collection class that can store zero or more IEntity objects. The entities stored by this interface are type specified and must be defined by a single IEntityDescriptor. The Selection class is ordered and contained entities can be accesed by index. The class does not accept duplicate entities if contained entity has identity fields.
Nested Class Summary | |
protected class |
Selection.EntityPoolSet
|
protected class |
Selection.EntityRelayListener
|
protected class |
Selection.SelectionList
|
Constructor Summary | |
Selection(IEntityDescriptor entityDescriptor)
|
|
Selection(ISelection selection)
This is a copy constructor that makes a shallow copy of the contained entities in the provided collection. |
Method Summary | |
boolean |
addEntity(IEntity entity)
Adds the provided IEntity object to the end of selection object. |
boolean |
addEntity(int index,
IEntity entity)
Adds the provided IEntity object to at the specified index in the selection object. |
void |
addEntityChangeListener(IEntityChangeListener listener)
Adds IEntityChangeListener to receive notifications of performed data operations on all entities contained in the collection object. |
void |
addEntityListener(IEntityListener listener)
Adds IEntityListener to receive notifications of performed data operations on all entities contained in the collection object. |
void |
addSelectionListener(ISelectionListener listener)
Adds an ISelectionListener to receive notifiactions of changes in the entity content of the collection object. |
java.util.List |
asList()
Returns a List that acts as a wrapper for the selection. |
java.util.Set |
asSet()
Returns a Set that acts as a wrapper for the selection. |
void |
clear()
Mutation method the removes all entities currently stored in the selection. |
boolean |
contains(IEntity entity)
Help method that returns true if the provided IEntity object exists in the selection otherwise false is returned. |
ISelection |
createSubSelection(int[] indexArray)
Creates a sub selection with the indexed entities in the called selection. |
ISelection |
createSubSelection(Qualifier qualifier)
Creates a sub selection with all qualified entities in the called selection. |
void |
deleteAll()
Deletes all contained entities. |
boolean |
doesAccept(IEntity entity)
Help method that returns true if the provided IEntity object will be accepted by the selection if added or inserted to it. |
protected void |
fireContentsChanged()
Help method to fire a SelectionEvent to all registered SelectionListeners for notification of generally changed contents. |
protected void |
fireEntityAdded(IEntity entity,
int row)
Help method to fire a SelectionEvent to all registered SelectionListeners for notification of an added entity. |
protected void |
fireEntityRemoved(IEntity entity,
int row)
Help method to fire a SelectionEvent to all registered SelectionListeners for notification of an removed entity. |
java.lang.Object |
getData(int row,
int column)
Access method that views the selection objct as a grid where row is the entity index and column is the field index for the stored entities. |
IEntity |
getEntity(int index)
Access method that returns the contained IEntity object with the specified index. |
IEntityDescriptor |
getEntityDescriptor()
Access method that returns the IEntityDescriptor for the selection. |
int |
indexOf(IEntity entity)
Help method that returns the index of the provided IEntity object in the selection if it exists othewise a negative value is returned. |
int |
indexOf(IFieldDescriptor fieldDescriptor,
java.lang.Object fieldData)
Help method that returns the index of the the first entity object in the selection with the specified field set to the specified value. |
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()
Boolean access method that return true if the selection is empty. |
java.util.Iterator |
iterator()
Returns a java.util.Iterator object that iterates over all entities in the selection. |
void |
log(java.lang.Object source)
Help method that logs text information from the collection object using the log package. |
void |
log(java.lang.Object source,
IFieldDescriptor[] fields)
Help method that logs text information from the collection object using the log package. |
void |
refreshAll()
Performs a refresh on all contained entities. |
protected void |
registerEntityChangeListener()
Adds a IEntityChangeListener to all contained entities that relays events to IEntityChangeListener registered in the collection object. |
protected void |
registerEntityListener()
Adds a IEntityListener to all contained entities that relays events to IEntityListener registered in the collection object. |
protected void |
registerListeners(IEntity entity)
Adds listeners relaying events from the specified entity to relevant listeners registered in the collection object. |
boolean |
removeEntity(IEntity entity)
Mutation method that removes the provided entity from the selection. |
IEntity |
removeEntity(int index)
Mutation method that removes the indexed entity from the selection. |
void |
removeEntityChangeListener(IEntityChangeListener listener)
Removes the specified IEntityListener from the collection object. |
void |
removeEntityListener(IEntityListener listener)
Removes the specified IEntityListener from the collection object. |
void |
removeSelectionListener(ISelectionListener listener)
Removes an ISelectionListener from the collection object. |
void |
setData(int row,
int column,
java.lang.Object dataValue)
Mutation method that views the selection objct as a grid where row is the entity index and column is the field index for the stored entities. |
int |
size()
Access method that reurns the number entities currently contained in the selection object. |
void |
sort(java.util.Comparator comparator)
This method sorts the called selection using the provided comparator. |
void |
storeAll()
Stores all contained entities that have the DIRTY flag set to true. |
protected void |
unregisterEntityChangeListener()
Removes the IEntityChangeListener from all contained entities that relays events to IEntityChangeListener registered in the collection object. |
protected void |
unregisterEntityListener()
Removes the IEntityListener from all contained entities that relays events to IEntityListener registered in the collection object. |
protected void |
unregisterListeners(IEntity entity)
Removes listeners relaying events from the specified entity to relevant listeners registered in the collection object. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Selection(IEntityDescriptor entityDescriptor)
public Selection(ISelection selection)
Method Detail |
public boolean isDirty()
isDirty
in interface ISelection
public void storeAll()
storeAll
in interface ISelection
public void deleteAll()
deleteAll
in interface ISelection
public void refreshAll()
refreshAll
in interface ISelection
public boolean addEntity(IEntity entity)
addEntity
in interface ISelection
public boolean addEntity(int index, IEntity entity)
addEntity
in interface ISelection
public IEntity getEntity(int index)
getEntity
in interface ISelection
public boolean removeEntity(IEntity entity)
removeEntity
in interface ISelection
public IEntity removeEntity(int index)
removeEntity
in interface ISelection
public java.util.Iterator iterator()
iterator
in interface ISelection
public void clear()
clear
in interface ISelection
public int size()
size
in interface ISelection
public boolean isEmpty()
isEmpty
in interface ISelection
public java.lang.Object getData(int row, int column)
getData
in interface ISelection
public void setData(int row, int column, java.lang.Object dataValue)
setData
in interface ISelection
public IEntityDescriptor getEntityDescriptor()
getEntityDescriptor
in interface ISelection
public ISelection createSubSelection(int[] indexArray)
createSubSelection
in interface ISelection
public ISelection createSubSelection(Qualifier qualifier)
createSubSelection
in interface ISelection
public boolean contains(IEntity entity)
contains
in interface ISelection
public int indexOf(IEntity entity)
indexOf
in interface ISelection
public int indexOf(IFieldDescriptor fieldDescriptor, java.lang.Object fieldData)
indexOf
in interface ISelection
public boolean doesAccept(IEntity entity)
doesAccept
in interface ISelection
public void sort(java.util.Comparator comparator)
sort
in interface ISelection
EntityCollator
public java.util.Set asSet()
asSet
in interface ISelection
public java.util.List asList()
asList
in interface ISelection
public void addSelectionListener(ISelectionListener listener)
addSelectionListener
in interface ISelection
public void removeSelectionListener(ISelectionListener listener)
removeSelectionListener
in interface ISelection
public void addEntityListener(IEntityListener listener)
addEntityListener
in interface ISelection
public void removeEntityListener(IEntityListener listener)
removeEntityListener
in interface ISelection
public void addEntityChangeListener(IEntityChangeListener listener)
addEntityChangeListener
in interface ISelection
public void removeEntityChangeListener(IEntityChangeListener listener)
removeEntityChangeListener
in interface ISelection
protected void fireContentsChanged()
protected void fireEntityAdded(IEntity entity, int row)
protected void fireEntityRemoved(IEntity entity, int row)
protected void registerListeners(IEntity entity)
protected void unregisterListeners(IEntity entity)
protected void registerEntityListener()
protected void unregisterEntityListener()
protected void registerEntityChangeListener()
protected void unregisterEntityChangeListener()
public void log(java.lang.Object source)
public void log(java.lang.Object source, IFieldDescriptor[] fields)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |