|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.trinity.cs.gamecore.GameEntityList<B,E>
public class GameEntityList<B extends Block<B,E>,E extends GameEntity<B,E>>
This class is a basic implementation of a linked list that can hold GameEntity objects. Students will use it for some of the early assignments.
This class is a generic that takes the general block type and the general entity type for each game.
| Constructor Summary | |
|---|---|
GameEntityList()
|
|
| Method Summary | |
|---|---|
void |
add(E entity)
Adds the specified entity to the list. |
java.util.Iterator<E> |
createIterator()
Returns an Iterator object that can be used to "walk through" the list of entities. |
void |
remove(E entity)
Searches for the specified entity in the screen and removes it if found. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public GameEntityList()
| Method Detail |
|---|
public java.util.Iterator<E> createIterator()
Iteratorpublic void add(E entity)
entity - The entity to add to the list.
public void remove(E entity)
throws java.util.NoSuchElementException
entity - The entity to remove.
java.util.NoSuchElementException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||