hermes
Class Group<A extends HObject>

java.lang.Object
  extended by hermes.GenericGroup<A,java.util.ArrayList<A>>
      extended by hermes.Group<A>
Type Parameters:
A - the type of being to be stored
All Implemented Interfaces:
KeySubscriber, MouseSubscriber, MouseWheelSubscriber, OscSubscriber

public class Group<A extends HObject>
extends GenericGroup<A,java.util.ArrayList<A>>

Groups together Beings that share common attributes and interact with other HObjects.

Group uses an ArrayList to keep track of Beings. Use GenericGroup if you want to use a different data structure or keep track of things that aren't Beings.

Groups are used for the same reasons as GenericGroups. See JavaDocs for GenericGroup for more details.


Field Summary
 
Fields inherited from class hermes.GenericGroup
_world
 
Constructor Summary
Group(World world)
          Constructs a new empty group.
 
Method Summary
 A get(int index)
          Retrieves the being at a specific index.
 int getIndex(A being)
          Finds the location of being in the group.
 
Methods inherited from class hermes.GenericGroup
add, addAll, clear, destroy, getObjects, getWorld, hasNeedsMoreSamples, iterator, receive, receive, receive, receive, remove, removeAll, setWorld, size, update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Group

public Group(World world)
Constructs a new empty group.

Parameters:
world - the world containing the group
Method Detail

get

public A get(int index)
Retrieves the being at a specific index.

Parameters:
index - the index to fetch from
Returns:
the being at index

getIndex

public int getIndex(A being)
Finds the location of being in the group.

Parameters:
being - the being
Returns:
the index at which the being is stored