org.datamanager.tools
Class EntityList

java.lang.Object
  |
  +--org.datamanager.tools.EntityList

public class EntityList
extends Object

A container class that is holds a list of Entities. Entities may be added, and removed also.

Author:
Gordon Murphy, gpmurphy@indiana.edu
, Bryan Dawson, bdawson@indiana.edu

Constructor Summary
EntityList()
          Create a new EntityList with the default length.
EntityList(Entity[] list)
          Create a new EntityList containing the specified entity array.
 
Method Summary
 void add(Entity entity)
          Adds the specified entity to the list.
 void add(int index, Entity entity)
          Inserts a entity at the specified index.
 void addEntities(EntityList entities)
          Append the specified list to the list.
 boolean contains(Entity entity)
          Returns true if the list contains the specified entity.
 Entity get(int index)
          Retrieves the entity at the specified index.
 void remove(Entity entity)
          Removes the specified entity from the list.
 Entity remove(int index)
          Removes the entity at the specified index and returns it.
 void removeEntities(EntityList entities)
          Removes the specified list from this list.
 int size()
          The number of entities in the list.
 String toString()
          Converts the contents to a string representation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

EntityList

public EntityList()
Create a new EntityList with the default length.


EntityList

public EntityList(Entity[] list)
Create a new EntityList containing the specified entity array.

Method Detail

get

public Entity get(int index)
Retrieves the entity at the specified index.

Parameters:
index - the index to retrieve the entity from
Returns:
the entity at index

size

public int size()
The number of entities in the list.

Returns:
the number of entities in the list

contains

public boolean contains(Entity entity)
Returns true if the list contains the specified entity.

Returns:
true or false

add

public void add(int index,
                Entity entity)
Inserts a entity at the specified index.

Parameters:
entity - the entity to add
index - the index to insert the entity at

add

public void add(Entity entity)
Adds the specified entity to the list.

Parameters:
entity - the entity to add

addEntities

public void addEntities(EntityList entities)
Append the specified list to the list.

Parameters:
entities - the EntityList to append to the end of this list

remove

public Entity remove(int index)
Removes the entity at the specified index and returns it.

Parameters:
index - the index to remove the entity at.
Returns:
the entity removed

remove

public void remove(Entity entity)
Removes the specified entity from the list.

Parameters:
entity - the entity to remove

removeEntities

public void removeEntities(EntityList entities)
Removes the specified list from this list.

Parameters:
entities - the EntityList to remove from this list

toString

public String toString()
Converts the contents to a string representation

Overrides:
toString in class Object
Returns:
a string representation of the contents


See the Helium Website