inria.util
Class EntityTable

java.lang.Object
  |
  +--java.util.AbstractCollection
        |
        +--java.util.AbstractList
              |
              +--java.util.Vector
                    |
                    +--inria.util.EntityTable
All Implemented Interfaces:
java.lang.Cloneable, java.util.Collection, java.util.List, java.io.Serializable

public class EntityTable
extends java.util.Vector

EntityTable contains a set of entities indexed by ID. An EntityTable is generally cheaper and offers faster access than Hashtable. All entities are sorted in the table by ID.

See Also:
Serialized Form

Fields inherited from class java.util.Vector
capacityIncrement, elementCount, elementData
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
EntityTable()
          constructs an EntityTable object.
EntityTable(int initialCapacity, int increments)
          constructs an EntityTable object.
 
Method Summary
 void addEntity(Entity obj)
          adds the given entity to the table.
 boolean containEntity(int id)
          contains the entity.
 Entity getEntity(int id)
          gets the entity.
 void removeEntity(Entity obj)
          remove the given entity from the table.
 void removeEntity(int id)
          remove the entity with the given ID from the table.
 
Methods inherited from class java.util.Vector
add, add, addAll, addAll, addElement, capacity, clear, clone, contains, containsAll, copyInto, elementAt, elements, ensureCapacity, equals, firstElement, get, hashCode, indexOf, indexOf, insertElementAt, isEmpty, lastElement, lastIndexOf, lastIndexOf, remove, remove, removeAll, removeAllElements, removeElement, removeElementAt, removeRange, retainAll, set, setElementAt, setSize, size, subList, toArray, toArray, toString, trimToSize
 
Methods inherited from class java.util.AbstractList
iterator, listIterator, listIterator
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
iterator, listIterator, listIterator
 

Constructor Detail

EntityTable

public EntityTable()
constructs an EntityTable object.

EntityTable

public EntityTable(int initialCapacity,
                   int increments)
constructs an EntityTable object.
Parameters:
initialCapacity - the initial capacity.
increments - the increments for expanding the table.
Method Detail

addEntity

public void addEntity(Entity obj)
adds the given entity to the table.
Parameters:
obj - the entity to be added.

containEntity

public boolean containEntity(int id)
contains the entity.
Parameters:
id - the entity ID.

getEntity

public Entity getEntity(int id)
gets the entity.
Parameters:
id - the entity ID.

removeEntity

public void removeEntity(Entity obj)
remove the given entity from the table.
Parameters:
obj - the entity to remove.

removeEntity

public void removeEntity(int id)
remove the entity with the given ID from the table.
Parameters:
id - the entity ID.


JavaTM Reliable MulticastTM Service version 1.1
Copyright (c) 2001, Sun Microsystems Laboratories, All rights reserved.