|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.datamanager.kernel.Entity
The major workhorse of the DataManager, Entity is an abstract class which only implements the create() method and the default, no args constructor. The addBase(), removeBase(), attach(), and detach() methods are needed to help uncouple the implementation of Entity storage and the kernel API. They are used inside the kernel by the EntityProxy. No one outside of the kernel should extend Entity so it is mostly safe to have these. Actually, since no one outside of the kernel can see Identifier it should be impossible to extend Entity outside of the kernel now.
Constructor Summary | |
protected |
Entity()
A constructor existing only for the sake of subclasses. |
Method Summary | |
protected abstract void |
addBase(org.datamanager.kernel.Identifier identifier)
Add an Entity to the list of bases. |
abstract void |
attach(Entity attribute)
Attach the given Entity as an attribute. |
protected abstract void |
attach(org.datamanager.kernel.Identifier identifier)
Attach the Entity with the given Identifier as an attribute. |
protected Entity[] |
chooseEntities(EntityConstraint constraint,
List candidateEntityIdentifiers)
Returns an array of all the Entities in the given List that satisfy the given Constraint. |
protected boolean |
constraintAcceptsEntity(EntityConstraint constraint,
org.datamanager.kernel.Identifier entityIdentifier)
Returns true if the EntityConstraint accepts the Entity associated with the Identifier; false if not. |
static Entity |
create(String name)
Create a new Entity with the given name. |
abstract void |
detach(Entity attribute)
Detach the given Entity. |
protected abstract void |
detach(org.datamanager.kernel.Identifier identifier)
Detach the Entity with the given Identifier. |
abstract Entity[] |
getAttributes(EntityConstraint constraint)
Request a constrained set of all entities linked to the Entity. |
abstract Entity[] |
getBases(EntityConstraint constraint)
Request a constrained set of all entities of which the Entity is an attribute. |
protected Entity[] |
getEntities(List entityList)
Turns a List of Entities into an Array of Entities. |
abstract String |
getName()
Request the Entity's name. |
abstract EntityValue |
getValue()
Request the Entity's value. |
protected List |
makeIdentifierList(org.datamanager.kernel.Identifier[] identifierArray)
Creates a list of Identifiers from the given array of Identifiers. |
protected abstract void |
removeBase(org.datamanager.kernel.Identifier identifier)
Remove an Entity from the list of bases. |
protected abstract void |
setAttributes(org.datamanager.kernel.Identifier[] attributeIdentifiers)
Sets the list of all attributes on this Entity. |
protected abstract void |
setBases(org.datamanager.kernel.Identifier[] baseIdentifiers)
Sets the list of all bases on this Entity. |
abstract void |
setValue(EntityValue value)
Request a change of the Entity's value. |
abstract void |
subscribe(EventHandler listener,
EventConstraint constraint)
Subscribe to the Entity for DataManagerEvents satisfying the given EventConstraint. |
abstract String |
toString()
A toString() method that overrides the one in Object. |
abstract void |
unsubscribe(EventHandler handler)
Remove all event subscriptions for which the EventHandler is subscribed. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
protected Entity()
Method Detail |
public static Entity create(String name) throws DataManagerException
name
- The name of the new Entity.
DataManagerException
public abstract void attach(Entity attribute) throws DataManagerException
attribute
- The Entity to attach.
DataManagerException
public abstract void detach(Entity attribute) throws DataManagerException
attribute
- The Entity to detach.
DataManagerException
public abstract String getName() throws DataManagerException
DataManagerException
public abstract EntityValue getValue() throws DataManagerException
DataManagerException
public abstract void setValue(EntityValue value) throws DataManagerException
value
- The new EntityValue that you wish to give the Entity.
DataManagerException
public abstract Entity[] getAttributes(EntityConstraint constraint) throws DataManagerException
constraint
- A constraint with which to filter attributes.
DataManagerException
protected abstract void setAttributes(org.datamanager.kernel.Identifier[] attributeIdentifiers) throws DataManagerException
DataManagerException
public abstract Entity[] getBases(EntityConstraint constraint) throws DataManagerException
constraint
- The EntityConstraint that you wish to apply to get the
bases of the Entity.
DataManagerException
protected abstract void setBases(org.datamanager.kernel.Identifier[] baseIdentifiers) throws DataManagerException
DataManagerException
public abstract void subscribe(EventHandler listener, EventConstraint constraint) throws DataManagerException
subscribe
in interface EventGenerator
listener
- The EventHandler that will receive the events.constraint
- The constraint used to filter events.
DataManagerException
public abstract void unsubscribe(EventHandler handler) throws DataManagerException
unsubscribe
in interface EventGenerator
handler
- The EventHandler to unsubscribe.
DataManagerException
public abstract String toString()
toString
in class Object
protected abstract void addBase(org.datamanager.kernel.Identifier identifier) throws DataManagerException
identifier
- The Identifier of the Entity that is a new base.
DataManagerException
protected abstract void removeBase(org.datamanager.kernel.Identifier identifier) throws DataManagerException
identifier
- The Identifier of the Entity that will no longer
be a base.
DataManagerException
protected abstract void attach(org.datamanager.kernel.Identifier identifier) throws DataManagerException
identifier
- The Identifier of the Entity to attach.
DataManagerException
protected abstract void detach(org.datamanager.kernel.Identifier identifier) throws DataManagerException
identifier
- The Identifier of the Entity to detach.
DataManagerException
protected Entity[] chooseEntities(EntityConstraint constraint, List candidateEntityIdentifiers) throws DataManagerException
constraint
- An EntityConstraint to filter the entities with.candidateEntityIdentifiers
- A List of Identifiers for candidate Entitys
to chose from.
DataManagerException
protected Entity[] getEntities(List entityList)
entityList
- A List of Entities to turn into an array.
protected boolean constraintAcceptsEntity(EntityConstraint constraint, org.datamanager.kernel.Identifier entityIdentifier) throws DataManagerException
constraint
- An EntityConstraint to test the Entity associated with
the Identifier against.entityIdentifier
- An Identifier for the Entity that we wish to test.
DataManagerException
protected List makeIdentifierList(org.datamanager.kernel.Identifier[] identifierArray)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |