|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
The EntityList interface describes the functions that must be provided for
managing entities within an ordered list. This container allows for operations
to manage entities(for example, to add or remove entities) and to add and
remove event listeners that listen for changes in this EntityList.
Index values identifying entity positions start at zero (0).
Several operations can throw an EntityListException. These exceptions allow events to be communicated to the user.
Method Summary | |
boolean |
addEntity(java.lang.Object entityInstance)
Adds a new entity to this EntityList . |
void |
addEntityListListener(EntityListListener e)
Adds a listener for list change events. |
int |
getCount()
Returns the number of entities stored in this EntityList . |
java.lang.Object |
getDefaultEntity()
Returns an entity instance containing desirable default values. |
java.lang.Object |
getEntity(int index)
Returns the entity instance stored in the specified position. |
java.lang.Object |
getNewDefaultEntity()
Returns a new instance of the entity being managed by this Entitylist. |
java.lang.Object |
getNewEntity()
Returns a new instance of the entity being managed by this Entitylist. |
boolean |
insertEntity(int index,
java.lang.Object entityValue)
Inserts an entity into this EntityList. |
boolean |
moveEntity(int startIndex,
int endIndex,
int newIndex)
Moves entities starting from the start index, to the end index, to a new location starting at the new index given. |
boolean |
removeEntity(int index)
Removes the specified entity. |
void |
removeEntityListListener(EntityListListener e)
Removes an entity list listener so that list changes will not trigger events for that listener. |
void |
replaceAll(EntityList v)
Replaces all the current entities with those given by the EntityList parameter. |
void |
setDefaultEntity(java.lang.Object o)
Sets the entity that contains desirable default values. |
boolean |
setEntity(int index,
java.lang.Object entityInstance)
Replaces the entity instance at the specified index. |
Method Detail |
public int getCount()
EntityList
.
public java.lang.Object getEntity(int index)
index
- position from which to get the entity
Object
entity at the specified positionpublic boolean setEntity(int index, java.lang.Object entityInstance) throws EntityListException
index
- the position of the entity to be replacedentityInstance
- the Object instance which will replace the original
EntityListException
- on EntityList events. It is used to
communicate events to the user.public java.lang.Object getNewEntity()
Object
reference to the new entity instancepublic java.lang.Object getNewDefaultEntity()
Object
reference to the new entity instancepublic java.lang.Object getDefaultEntity()
public void setDefaultEntity(java.lang.Object o)
o
- the Object
representing the entity holding
the desirable valuespublic boolean addEntity(java.lang.Object entityInstance) throws EntityListException
EntityList
. The entity
is placed at the end of this EntityList
.
entityInstance
- the Object to add
EntityListException
- on EntityList events. It is used to
communicate events to the user.public boolean insertEntity(int index, java.lang.Object entityValue) throws EntityListException
index
- the index where the entity object will be placedentityValue
- the Object to insert
EntityListException
- on EntityList events. It is used to
communicate events to the user.public boolean moveEntity(int startIndex, int endIndex, int newIndex) throws EntityListException
startIndex
- the index of the first entity to moveendIndex
- index of the last entity to movenewIndex
- the destination index
EntityListException
- on EntityList events. It is used to
communicate events to the user.public boolean removeEntity(int index) throws EntityListException
index
- the index of the entity to remove
EntityListException
- on EntityList events. It is used to
communicate events to the user.public void replaceAll(EntityList v)
v
- the EntityList holding the new entitiespublic void addEntityListListener(EntityListListener e)
e
- the EntityListListener to addpublic void removeEntityListListener(EntityListListener e)
e
- the EntityListListener to remove
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |