org.caleigo.core
Class QualifiedSelection

java.lang.Object
  extended byorg.caleigo.core.Selection
      extended byorg.caleigo.core.QualifiedSelection
All Implemented Interfaces:
IEntityPool, IQualifiedSelection, ISelection, java.io.Serializable

public class QualifiedSelection
extends Selection
implements IQualifiedSelection

EntitySelection 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 EntitySelection differs from EntityCollection by using a contained Qualifier to define the scope of the contained entity objects. This means that the collection does not accept objects that are not qualified by the the defined Qualifier. This means that if data is change in a contained etity that "unqualifies" it it will automatically be removed from the collection. Also a call to RefreshAll uses the qualifier to search for all entities defined that it qualifies which may change the number of contained entities according to external changes in the persistent storage. IEntitySelection is ordered and contained entities can be accesed by index.

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

Nested Class Summary
 
Nested classes inherited from class org.caleigo.core.Selection
Selection.EntityPoolSet, Selection.EntityRelayListener, Selection.SelectionList
 
Constructor Summary
QualifiedSelection(IEntityDescriptor entityDescriptor, Qualifier qualifier)
          This costructor will create a new selection object for the provided IEntityDescriptor.
QualifiedSelection(IQualifiedSelection selection)
          This is a copy constructor that makes a shallow copy of the contained entities in the provided selection.
 
Method Summary
 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.
 Qualifier getQualifier()
           
 void refreshAll()
          Performs a refresh on all contained entities.
 void setQualifier(Qualifier qualifier)
           
 
Methods inherited from class org.caleigo.core.Selection
addEntity, addEntity, addEntityChangeListener, addEntityListener, addSelectionListener, asList, asSet, clear, contains, createSubSelection, createSubSelection, deleteAll, fireContentsChanged, fireEntityAdded, fireEntityRemoved, getData, getEntity, getEntityDescriptor, indexOf, indexOf, isDirty, isEmpty, iterator, log, log, registerEntityChangeListener, registerEntityListener, registerListeners, removeEntity, removeEntity, removeEntityChangeListener, removeEntityListener, removeSelectionListener, setData, size, sort, storeAll, unregisterEntityChangeListener, unregisterEntityListener, unregisterListeners
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.caleigo.core.ISelection
addEntity, addEntity, addEntityChangeListener, addEntityListener, addSelectionListener, asList, asSet, clear, contains, createSubSelection, createSubSelection, deleteAll, getData, getEntity, getEntityDescriptor, indexOf, indexOf, isDirty, isEmpty, iterator, removeEntity, removeEntity, removeEntityChangeListener, removeEntityListener, removeSelectionListener, setData, size, sort, storeAll
 

Constructor Detail

QualifiedSelection

public QualifiedSelection(IEntityDescriptor entityDescriptor,
                          Qualifier qualifier)
This costructor will create a new selection object for the provided IEntityDescriptor. The selection will be loaded with entities from the default persistent storage using the provided qualifier that will define the scope of the selector.


QualifiedSelection

public QualifiedSelection(IQualifiedSelection selection)
This is a copy constructor that makes a shallow copy of the contained entities in the provided selection.

Method Detail

refreshAll

public void refreshAll()
Description copied from interface: ISelection
Performs a refresh on all contained entities. The refresh is batched to save performance.

Specified by:
refreshAll in interface ISelection
Overrides:
refreshAll in class Selection

doesAccept

public boolean doesAccept(IEntity entity)
Description copied from interface: ISelection
Help method that returns true if the provided IEntity object will be accepted by the selection if added or inserted to it. Reasons for not accepting an entity is wrong type (IEntityDescriptor), already included or if selection is qualified the entity may fail qualification.

Specified by:
doesAccept in interface ISelection
Overrides:
doesAccept in class Selection

getQualifier

public Qualifier getQualifier()
Specified by:
getQualifier in interface IQualifiedSelection

setQualifier

public void setQualifier(Qualifier qualifier)
Specified by:
setQualifier in interface IQualifiedSelection


Copyright © 2005 Caleigo. All Rights Reserved.