|
UC Berkeley Group for User Interface Research Updated November 17, 2000 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--edu.berkeley.guir.lib.collection.SortedValueMap | +--edu.berkeley.guir.lib.collection.SortedValueNumMap
A Map with any kind of uniquely named Keys with numerical Values, sorted by the values (not by keys). You can set whether the Map is sorted ascending or descending, whether each value has a threshold max value or not, and whether the sum of the values has a threshold max value or not.
This software is distributed under the Berkeley Software License.
Revisions: - GUIRLib-v1.0-1.0.0, Jun 16 1997, JH Created class - GUIRLib-v1.2-1.0.0, Jun 22 2000, JH Touched for GUIRLib release - GUIRLib-v1.3-1.0.0, Aug 11 2000, JH Touched for GUIRLib release - GUIRLib-v1.4-1.0.0, Aug 31 2000, JH Touched for GUIRLib release
Constructor Summary | |
SortedValueNumMap()
|
Method Summary | |
static void |
main(String[] argv)
|
void |
put(Object key,
double num)
Convenience method, puts number in as a Double object. |
void |
put(Object key,
float num)
Convenience method, puts number in as a Double object. |
void |
put(Object key,
int num)
Convenience method, puts number in as a Double object. |
void |
put(Object key,
Number num)
Add a key and its value. |
void |
setAscending(boolean flag)
Use this BEFORE you stick in items. |
static void |
setDefaultAscending(boolean flag)
Set the default value for ascending or descending order. |
static void |
setDefaultSumThreshold(double d)
Set the default sum threshold value. |
static void |
setDefaultThreshold(double d)
Set the default threshold value. |
static void |
setDefaultUseSumThreshold(boolean flag)
Set whether or not new SortedValueNumMaps should use the sum threshold value or not by default. |
static void |
setDefaultUseThreshold(boolean flag)
Set whether or not new SortedValueNumMaps should use the threshold value or not by default. |
void |
setSumThreshold(double d)
Set the threshold value for this SortedValueNumMap. |
void |
setThreshold(double d)
Set the threshold value for this SortedValueNumMap. |
void |
setUseSumThreshold(boolean flag)
Use the current sum threshold value, or just ignore checking the sum? |
void |
setUseThreshold(boolean flag)
Use the current threshold value, or just ignore checking values? |
Methods inherited from class edu.berkeley.guir.lib.collection.SortedValueMap |
clear, containsKey, containsValue, entrySet, equals, get, getFirstKey, getFirstValue, getLargestKey, getLargestValue, getLastKey, getLastValue, getSmallestKey, getSmallestValue, isEmpty, keySet, put, putAll, remove, size, toString, values |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public SortedValueNumMap()
Method Detail |
public void setAscending(boolean flag)
setAscending
in class SortedValueMap
flag
- is true if ascending order, false if descending.public void setThreshold(double d)
d
- is the threshold value to set to.public void setUseThreshold(boolean flag)
flag
- is true if we should check values against the threshold,
otherwise false.public void setSumThreshold(double d)
d
- is the threshold sum value to set to.public void setUseSumThreshold(boolean flag)
flag
- is true if we should check sums against the sum threshold,
otherwise false.public static void setDefaultAscending(boolean flag)
flag
- is true if new SortedValueNumMaps should sort in ascending
order, false if in descending order.public static void setDefaultThreshold(double d)
f
- is the default threshold value to set to.setThreshold(double)
public static void setDefaultUseThreshold(boolean flag)
flag
- is true if new SortedValueNumMaps should use threshold
value.setThreshold(double)
,
setDefaultThreshold(double)
public static void setDefaultSumThreshold(double d)
d
- is the default threshold value to set to.setSumThreshold(double)
public static void setDefaultUseSumThreshold(boolean flag)
flag
- is true if new SortedValueNumMaps should use threshold
value.setSumThreshold(double)
,
setDefaultSumThreshold(double)
public void put(Object key, int num)
public void put(Object key, float num)
public void put(Object key, double num)
public void put(Object key, Number num)
key
- is the name of the key. if the key already exists, this
will overwrite the previous value.value
- is the value. Ensures that the value
and the sum of the values does not exceed threshold.NumberFormatException
- if the value or the sum exceeds
sumThreshold.IllegalArgumentException
- if the same name is added more
than once.public static void main(String[] argv)
|
Copyright Information | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |