|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.charlesames.utility.common.Disposable
net.charlesames.utility.entity.Entity
public abstract class Entity
Entity is an abstract base class enhancing Object.
It adds four properties:
A reference to the container which holds this entity.
An integer ID which should be unique under the container (defaults to Integer.MIN_VALUE).
A text Name (defaults to blank);
A Handle which is unique among all Entity instances created during
the current execution session. This value should not be persisted to file.
A Status property.
A Modifiable flag.
| Method Summary | |
|---|---|
void |
decrementReferenceCount()
Decrement the count of objects referencing this one. |
static Entity |
dereferenceHandle(long handle)
Dereference the Entity identified by the indicated handle. |
void |
dispose()
Render this Entity amenable to garbage collection. |
boolean |
equals(Entity other)
Test if this Entity instance has the same content as another Entity instance. |
EntityContainer |
getContainer()
Getter for the Container property. |
long |
getHandle()
Get the globally unique handle identifying this Entity. |
int |
getID()
Getter for the ID property. |
java.lang.String |
getName()
Getter for the Name property. |
java.lang.String |
getPath()
Return a description of this entity and its containers. |
int |
getReferenceCount()
Get the count of objects referencing this one. |
Status |
getStatus()
Getter for the Status property. |
java.lang.String |
getText()
Return a unique description of this entity. |
boolean |
hasContainer()
Test if Container property is populated. |
void |
incrementReferenceCount()
Increment the count of objects referencing this one. |
boolean |
isModifiable()
Getter for the Modifiable property. |
boolean |
methodHasOverride(java.lang.Class<?> baseClass,
java.lang.String methodName)
Test if a class has overridden a base-class method. |
Entity |
predecessor(java.util.SortedMap<java.lang.Integer,? extends Entity> entities,
int minID)
|
static void |
resequenceEntities(java.util.SortedMap<java.lang.Integer,? extends Entity> entities,
int minID)
A helper function which removes gaps from a sequence of entity id's. |
void |
setContainer(EntityContainer container)
Setter for the Container property. |
boolean |
setID(int value)
Setter for the ID property. |
void |
setModifiable(boolean modifiable)
Setter for the Modifiable property. |
boolean |
setName(java.lang.String value)
Setter for the Name property. |
boolean |
setStatus(Status value)
Setter for the Status property. |
static void |
shiftEntitiesDown(int startingID,
int increment,
java.util.SortedMap<java.lang.Integer,? extends Entity> entities,
int minID)
A helper function which moves a block of entities down within an id-indexed collection. |
static void |
shiftEntityDown(int id,
java.util.SortedMap<java.lang.Integer,? extends Entity> entities)
A helper function which moves a specified entity down within an id-indexed collection. |
static void |
shiftEntityUp(int id,
java.util.SortedMap<java.lang.Integer,? extends Entity> entities,
int minID)
A helper function which moves a specified entity up within an id-indexed collection. |
Entity |
successor(java.util.SortedMap<java.lang.Integer,? extends Entity> entities)
|
java.lang.String |
toString()
|
void |
wipe()
Clear all data in this Entity instance. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Method Detail |
|---|
public void wipe()
Entity instance.
public final void dispose()
Entity amenable to garbage collection.
dispose in class Disposablepublic EntityContainer getContainer()
Container property.
Container value.public final boolean hasContainer()
Container property is populated.
public void setContainer(EntityContainer container)
Container property.
container - The intended Container value.public boolean isModifiable()
Modifiable property.
Modifiable value.public void setModifiable(boolean modifiable)
Modifiable property.
modifiable - The intended Modifiable value.public final int getID()
ID property.
ID value.public boolean setID(int value)
ID property.
value - The intended ID value.
ID change actually happened; false otherwise.public java.lang.String getName()
Name property.
Name value.public boolean setName(java.lang.String value)
Name property.
value - The intended Name value.
Name change actually happened; false otherwise.public final int getReferenceCount()
public void incrementReferenceCount()
public void decrementReferenceCount()
public java.lang.String toString()
toString in class java.lang.Objectpublic long getHandle()
Entity.
Entity.public static Entity dereferenceHandle(long handle)
Entity identified by the indicated handle.
handle - The indicated handle.
Entity identified by the indicated handle.public java.lang.String getText()
public java.lang.String getPath()
getPath in interface EntityContainerpublic final Status getStatus()
Status property.
Status value.public boolean setStatus(Status value)
Status property.
value - The intended Status value.
Status change actually happened; false otherwise.
public boolean methodHasOverride(java.lang.Class<?> baseClass,
java.lang.String methodName)
baseClass - The base class.methodName - The method name
public final Entity predecessor(java.util.SortedMap<java.lang.Integer,? extends Entity> entities,
int minID)
entities - An id-indexed collection which includes the present entity.minID - Lowest acceptable id value.
public final Entity successor(java.util.SortedMap<java.lang.Integer,? extends Entity> entities)
entities - An id-indexed collection which includes the present entity.
public static void resequenceEntities(java.util.SortedMap<java.lang.Integer,? extends Entity> entities,
int minID)
entities - An id-indexed collection.minID - Lowest acceptable id value.
public static void shiftEntityUp(int id,
java.util.SortedMap<java.lang.Integer,? extends Entity> entities,
int minID)
id - The entity identities - An id-indexed collection.minID - Lowest acceptable id value.
public static void shiftEntityDown(int id,
java.util.SortedMap<java.lang.Integer,? extends Entity> entities)
id - The entity identities - An id-indexed collection.
public static void shiftEntitiesDown(int startingID,
int increment,
java.util.SortedMap<java.lang.Integer,? extends Entity> entities,
int minID)
startingID - All entities in the collection with id's greater than or equal to the startingID will be shifted down.increment - Number of positions to shiftentities - An id-indexed collection.minID - Lowest acceptable id value.public boolean equals(Entity other)
Entity instance has the same content as another Entity instance.
other - The other Entity instance.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||