|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.util.AbstractMap<Coord,Integer>
com.threerings.tudey.util.CoordIntMap
public class CoordIntMap
Maps pairs of integer coordinates to integer values.
| Nested Class Summary | |
|---|---|
static class |
CoordIntMap.CoordIntEntry
An entry in the map. |
| Nested classes/interfaces inherited from class java.util.AbstractMap |
|---|
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V> |
| Nested classes/interfaces inherited from interface java.util.Map |
|---|
Map.Entry<K,V> |
| Constructor Summary | |
|---|---|
CoordIntMap()
Creates a new coord int map with a top-level cell size of 8x8 and with the value -1 representing the absence of an entry. |
|
CoordIntMap(int granularity)
Creates a new coord int map with the value -1 representing the absence of an entry. |
|
CoordIntMap(int granularity,
int empty)
Creates a new coord int map. |
|
| Method Summary | |
|---|---|
void |
clear()
|
boolean |
containsKey(int x,
int y)
Determines whether this map contains an entry for the specified coordinates. |
boolean |
containsKey(Object key)
|
boolean |
containsValue(int value)
Determines whether this map contains the specified value. |
boolean |
containsValue(Object value)
|
Set<CoordIntMap.CoordIntEntry> |
coordIntEntrySet()
Returns a set view of the map entries. |
Set<Map.Entry<Coord,Integer>> |
entrySet()
|
int |
get(int x,
int y)
Retrieves the value at the specified coordinates. |
Integer |
get(Object key)
|
boolean |
isEmpty()
|
Integer |
put(Coord key,
Integer value)
|
int |
put(int x,
int y,
int value)
Sets the value at the specified coordinates. |
void |
readFields(Importer in)
Custom field read method. |
int |
remove(int x,
int y)
Removes the value at the specified coordinates. |
Integer |
remove(Object key)
|
int |
setBits(int x,
int y,
int bits)
Stores the bitwise OR of the previous value and the specified bits at the specified coordinates. |
int |
size()
|
| Methods inherited from class java.util.AbstractMap |
|---|
equals, hashCode, keySet, putAll, toString, values |
| Methods inherited from class java.lang.Object |
|---|
getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public CoordIntMap()
public CoordIntMap(int granularity)
granularity - the size of the top-level cells, expressed as a power of two (e.g.,
3 for cell size 8).
public CoordIntMap(int granularity,
int empty)
granularity - the size of the top-level cells, expressed as a power of two (e.g.,
3 for a cell size of 8 by 8).empty - the value indicating the absence of an entry.| Method Detail |
|---|
public int get(int x,
int y)
public int put(int x,
int y,
int value)
public int setBits(int x,
int y,
int bits)
public int remove(int x,
int y)
public boolean containsKey(int x,
int y)
public boolean containsValue(int value)
public void readFields(Importer in)
throws IOException
IOExceptionpublic Set<CoordIntMap.CoordIntEntry> coordIntEntrySet()
public Set<Map.Entry<Coord,Integer>> entrySet()
entrySet in interface Map<Coord,Integer>entrySet in class AbstractMap<Coord,Integer>public boolean containsKey(Object key)
containsKey in interface Map<Coord,Integer>containsKey in class AbstractMap<Coord,Integer>public boolean containsValue(Object value)
containsValue in interface Map<Coord,Integer>containsValue in class AbstractMap<Coord,Integer>public Integer get(Object key)
get in interface Map<Coord,Integer>get in class AbstractMap<Coord,Integer>
public Integer put(Coord key,
Integer value)
put in interface Map<Coord,Integer>put in class AbstractMap<Coord,Integer>public Integer remove(Object key)
remove in interface Map<Coord,Integer>remove in class AbstractMap<Coord,Integer>public void clear()
clear in interface Map<Coord,Integer>clear in class AbstractMap<Coord,Integer>public int size()
size in interface Map<Coord,Integer>size in class AbstractMap<Coord,Integer>public boolean isEmpty()
isEmpty in interface Map<Coord,Integer>isEmpty in class AbstractMap<Coord,Integer>
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||