T - class of the objects to be contained in this map@ParametersAreNonnullByDefault
@MethodsReturnNonnullByDefault
public class XZMap<T extends XZAddressable>
extends java.lang.Object
implements java.lang.Iterable<T>
XZAddressable| Constructor and Description |
|---|
XZMap(float loadFactor,
int capacity)
Creates a new XZMap with the given load factor and initial capacity.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Removes all elements from the map.
|
boolean |
contains(int x,
int z)
Returns true if there exists an entry associated with the given xz-coordinates in this map.
|
boolean |
contains(T value)
Returns true if the given value is contained within this map.
|
T |
get(int x,
int z)
Returns the value associated with the given coordinates or null if no such value exists.
|
int |
getSize()
Returns the number of elements in this map
|
java.util.Iterator<T> |
iterator() |
T |
put(T value)
Associates the given value with its xz-coordinates.
|
T |
remove(int x,
int z)
Removes and returns the entry associated with the given coordinates.
|
T |
remove(T value)
Removes and returns the given value from this map.
|
public XZMap(float loadFactor,
int capacity)
loadFactor - the load factorcapacity - the initial capacitypublic int getSize()
public void clear()
@Nullable public T put(T value)
value - value to be associated with its coordinates@Nullable public T remove(int x, int z)
x - the x-coordinatez - the z-coordinate@Nullable public T remove(T value)
value - the value to be removed@Nullable public T get(int x, int z)
x - the x-coordinatez - the z-coordinatepublic boolean contains(int x,
int z)
x - the x-coordinatez - the y-coordinatepublic boolean contains(T value)
value - the valuepublic java.util.Iterator<T> iterator()
iterator in interface java.lang.Iterable<T extends XZAddressable>