|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.AbstractMap
java.util.HashMap
cds.util.SortedHashMap
HashMap allowing to display the entries in a particular order. By default
the same order as the elements were added to the table.
It is also possible to specify the position where the entry should be
placed in the list.
This is obtained by managing a ArrayList of the keys. It is then possible
to sort this list in any kind of order...
Nested Class Summary | |
(package private) class |
SortedHashMap.Iter
Inner class for creating an iterator on the SortedHashMap elements |
Nested classes inherited from class java.util.HashMap |
|
Nested classes inherited from class java.util.AbstractMap |
|
Field Summary | |
(package private) java.util.ArrayList |
keys
|
Fields inherited from class java.util.HashMap |
|
Fields inherited from class java.util.AbstractMap |
|
Constructor Summary | |
SortedHashMap()
Basic Constructor |
|
SortedHashMap(int inisize)
Constructor specifying an initial table size |
Method Summary | |
void |
add(java.lang.Object key,
int pos,
java.lang.Object data)
Add a new object with its key at a specified position The object will be added to the current list a the defined position. |
void |
add(java.lang.Object key,
java.lang.Object data)
Add an object with its key. |
void |
clear()
Empties the Sorted HashMap |
java.lang.Object |
get(int num)
Gets an entry specified by its rank number |
java.util.Iterator |
iterator()
Returns an iterator on the objects. |
java.util.Iterator |
keyIterator()
Returns an iterator to browse through the list of object keys in the order they were entered or explicitely placed. |
java.lang.Object |
replace(java.lang.Object key,
java.lang.Object data)
Replaces the value of an existing entry in the SortedHashMap The new data will replace the old one, which will be returned. |
java.lang.Object[] |
toArray()
Returns the list of object keys as an array |
java.lang.Object[] |
toArray(java.lang.Object[] o)
Returns the list of objects keys as an array of the specified type |
java.lang.Object[] |
toSortedArray()
Returns a sorted list of the item values in the hashMap |
Methods inherited from class java.util.HashMap |
clone, containsKey, containsValue, entrySet, get, isEmpty, keySet, put, putAll, remove, size, values |
Methods inherited from class java.util.AbstractMap |
equals, hashCode, toString |
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.Map |
equals, hashCode |
Field Detail |
java.util.ArrayList keys
Constructor Detail |
public SortedHashMap()
public SortedHashMap(int inisize)
inisize
- initial table sizeMethod Detail |
public void add(java.lang.Object key, java.lang.Object data) throws ExistenceException
key
- key allowing to retrieve the object through the HashMapdata
- object to add in the table
ExistenceException
public void add(java.lang.Object key, int pos, java.lang.Object data) throws ExistenceException
key
- key allowing to retrieve the object through the HashMappos
- the position in the list where the object should be placed.
If this place was already occupied, the new object will replace the old one.data
- object to add in the table
ExistenceException
public java.lang.Object replace(java.lang.Object key, java.lang.Object data)
key
- key of an existing object which value is replaceddata
- new data object to associate with the key
public java.util.Iterator iterator()
public java.util.Iterator keyIterator()
public java.lang.Object[] toSortedArray()
public void clear()
public java.lang.Object get(int num)
num
- number of the entrypublic java.lang.Object[] toArray()
public java.lang.Object[] toArray(java.lang.Object[] o)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |