| Constructor and Description |
|---|
MapObjects()
Creates an empty set of MapObject instances
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(MapObject object) |
MapObject |
get(int index) |
MapObject |
get(java.lang.String name) |
<T extends MapObject> |
getByType(java.lang.Class<T> type) |
<T extends MapObject> |
getByType(java.lang.Class<T> type,
Array<T> fill) |
int |
getCount() |
int |
getIndex(MapObject object)
Get the index of the object in the collection, or -1 if no such object exists.
|
int |
getIndex(java.lang.String name)
Get the index of the object having the specified name, or -1 if no such object exists.
|
java.util.Iterator<MapObject> |
iterator() |
void |
remove(int index) |
void |
remove(MapObject object) |
public MapObject get(int index)
index - public MapObject get(java.lang.String name)
name - public int getIndex(java.lang.String name)
public int getIndex(MapObject object)
public int getCount()
public void add(MapObject object)
object - instance to be added to the collectionpublic void remove(int index)
index - removes MapObject instance at indexpublic void remove(MapObject object)
object - instance to be removedpublic <T extends MapObject> Array<T> getByType(java.lang.Class<T> type)
type - class of the objects we want to retrievepublic <T extends MapObject> Array<T> getByType(java.lang.Class<T> type, Array<T> fill)
type - class of the objects we want to retrievefill - collection to put the returned objects in