hermes
Class Group<A extends HObject>
java.lang.Object
hermes.GenericGroup<A,java.util.ArrayList<A>>
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 HObject
s.
Group uses an ArrayList
to keep track of Being
s.
Use GenericGroup
if you want to use a different data structure
or keep track of things that aren't Being
s.
Groups are used for the same reasons as GenericGroup
s.
See JavaDocs for GenericGroup
for more details.
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 |
Group
public Group(World world)
- Constructs a new empty group.
- Parameters:
world
- the world containing the group
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