|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectgames.strategy.util.IntegerMap<T>
public class IntegerMap<T>
A utility class for mapping Objects to ints.
Supports adding and comparing of maps.
| Constructor Summary | |
|---|---|
IntegerMap()
Creates new IntegerMap |
|
IntegerMap(java.util.Collection<T> objects,
int value)
|
|
IntegerMap(int size)
|
|
IntegerMap(int size,
float loadFactor)
|
|
| Method Summary | |
|---|---|
void |
add(IntegerMap<T> map)
|
void |
add(T key,
int value)
|
void |
add(T key,
java.lang.Integer value)
|
void |
addAll(java.util.Collection<T> keys,
int value)
|
void |
addMultiple(IntegerMap<T> map,
int multiple)
Add map * multiple |
boolean |
allKeysMatch(Match<T> matcher)
|
void |
clear()
|
java.lang.Object |
clone()
|
IntegerMap<T> |
copy()
|
boolean |
equals(java.lang.Object o)
The equals method will only return true if both the keys and values match exactly. |
int |
getInt(T key)
returns 0 if no key found. |
java.util.Collection<T> |
getKeyMatches(Match<T> matcher)
|
boolean |
greaterThanOrEqualTo(IntegerMap<T> map)
By >= we mean that each of our entries is greater than or equal to each entry in the other map. |
boolean |
isPositive()
True if all values are >= 0. |
java.util.Set<T> |
keySet()
|
void |
put(T key,
int value)
|
void |
put(T key,
java.lang.Integer value)
|
void |
putAll(java.util.Collection<T> keys,
int value)
|
void |
removeKey(T key)
|
void |
removeMatchingKeys(Match<T> aMatch)
|
void |
removeNonMatchingKeys(Match<T> aMatch)
|
int |
size()
|
boolean |
someKeysMatch(Match<T> matcher)
|
void |
subtract(IntegerMap<T> map)
|
int |
sumMatches(Match<T> matcher)
|
java.lang.String |
toString()
|
int |
totalValues()
|
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public IntegerMap()
public IntegerMap(int size)
public IntegerMap(int size,
float loadFactor)
public IntegerMap(java.util.Collection<T> objects,
int value)
| Method Detail |
|---|
public int size()
public void put(T key,
java.lang.Integer value)
public void put(T key,
int value)
public void putAll(java.util.Collection<T> keys,
int value)
public void addAll(java.util.Collection<T> keys,
int value)
public int getInt(T key)
public void add(T key,
java.lang.Integer value)
public void add(T key,
int value)
public void clear()
public java.util.Set<T> keySet()
public int totalValues()
public void add(IntegerMap<T> map)
public void subtract(IntegerMap<T> map)
public boolean greaterThanOrEqualTo(IntegerMap<T> map)
public boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic boolean isPositive()
public IntegerMap<T> copy()
public java.lang.Object clone()
clone in class java.lang.Object
public void addMultiple(IntegerMap<T> map,
int multiple)
public boolean someKeysMatch(Match<T> matcher)
public boolean allKeysMatch(Match<T> matcher)
public java.util.Collection<T> getKeyMatches(Match<T> matcher)
public int sumMatches(Match<T> matcher)
public void removeNonMatchingKeys(Match<T> aMatch)
public void removeMatchingKeys(Match<T> aMatch)
public void removeKey(T key)
public java.lang.String toString()
toString in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||