public class SortedMap<A,B>
extends java.lang.Object
implements java.util.Map<A,B>, java.util.Comparator, java.io.Serializable
| Modifier and Type | Field and Description |
|---|---|
static int |
KEY
value to set sorting on KEY
|
static int |
NO_SORT
value to set NO SORTING
|
static int |
VALUE
value to set sorting on VALUE
|
| Constructor and Description |
|---|
SortedMap()
Constructor for SortedMap.
|
SortedMap(java.util.Hashtable ht)
Constructor for SortedMap.
|
SortedMap(int sortOrder)
Constructor for SortedMap.
|
SortedMap(java.util.Map map)
Constructor for SortedMap.
|
SortedMap(java.util.Map map,
int sortOrder)
Constructor for SortedMap.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clear() |
int |
compare(java.lang.Object oLeft,
java.lang.Object oRight)
compare to Objects and returns the natural order
Implementation takes the given sort order into account and will
compare the keys or values respectively.
|
boolean |
containsKey(java.lang.Object key) |
boolean |
containsValue(java.lang.Object value) |
java.util.Set |
entrySet() |
B |
get(java.lang.Object key)
Overwritten the default get for performance reasons
We bypass the entrySet() while it will sort the collection
first.
|
int |
getSortOrder()
gets the sort order.
|
boolean |
isEmpty() |
java.util.Set |
keySet() |
java.lang.Object |
put(java.lang.Object key,
java.lang.Object value)
SortedMap does not allow null for keys or values
|
void |
putAll(java.util.Map m) |
B |
remove(java.lang.Object key) |
void |
setSortOrder(int sortOrder)
sets the sort order for this SortedMap
|
int |
size() |
java.util.Collection |
values() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitpublic static final int KEY
public static final int VALUE
public static final int NO_SORT
public SortedMap(int sortOrder)
sortOrder - int in KEY|VALUE|SORTpublic SortedMap()
public SortedMap(java.util.Map map,
int sortOrder)
map - java.util.MapsortOrder - int in KEY|VALUE|SORTpublic SortedMap(java.util.Map map)
map - java.util.Mappublic SortedMap(java.util.Hashtable ht)
ht - Hashtablepublic int getSortOrder()
public void setSortOrder(int sortOrder)
sortOrder - int, the new sort order for this SortedMap,
possible values are: KEY,VALUE, NO_SORTpublic int compare(java.lang.Object oLeft,
java.lang.Object oRight)
compare in interface java.util.ComparatorComparator.compare(Object, Object)public java.util.Set entrySet()
public B get(java.lang.Object key)
public java.lang.Object put(java.lang.Object key,
java.lang.Object value)
public void putAll(java.util.Map m)
public B remove(java.lang.Object key)
public boolean containsKey(java.lang.Object key)
public boolean containsValue(java.lang.Object value)