|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectxml2fol.MapList<T>
public class MapList<T>
A utlity class that contains both a map (vector) and a list (hashtable) for a given data type. The data can be kept in one or both data structures.
Constructor Summary | |
---|---|
MapList()
Creates a MapList that keeps information in both Map and List and without a comparator. |
|
MapList(boolean storeMap,
boolean storeList)
Creates a MapList that the appropriate storeMap and storeList values and without a comparator. |
|
MapList(boolean storeMap,
boolean storeList,
java.util.Comparator c)
Creates a MapList that the appropriate storeMap and storeList values and with a comparator c. |
|
MapList(boolean storeMap,
boolean storeList,
java.util.Comparator c,
int size)
Creates a MapList of specified size that the appropriate storeMap and storeList values and with a comparator c. |
|
MapList(java.util.Comparator c)
Creates a MapList that keeps information in both Map and List and with a comparator c. |
Method Summary | |
---|---|
void |
Add(long key,
T element)
Adds element to MapList using key |
void |
Add(java.lang.String key,
T element)
Adds element to MapList using key |
void |
Clear()
Clears the values in the list and map |
boolean |
ContainsKey(long key)
Determines if MapList contains a specified key |
boolean |
ContainsKey(java.lang.String key)
Determines if MapList contains a specified key |
void |
CopyMapToList()
Copies all the values in the map to the list |
int |
GetListSize()
Returns the number of elements in the list |
java.lang.String |
GetListText()
Return all text in the list |
int |
GetMapSize()
Returns the number of elements in the map |
boolean |
GetStoreList()
Returns the value of the storeList |
boolean |
GetStoreMap()
Returns the value of the storeMap |
T |
GetUsingIndex(int index)
Gets an element from the MapList using the key |
T |
GetUsingKey(long key)
Gets an element from the MapList using the key |
T |
GetUsingKey(java.lang.String key)
Gets an element from the MapList using the key |
void |
PrintList()
Outputs all text in the list to the screen |
void |
SetStoreList(boolean saveList)
Sets the value of the storeList |
void |
SetStoreMap(boolean saveMap)
Sets the value of the storeMap |
void |
Sort()
Sorts the list if a valid comparator is advailable |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MapList()
public MapList(java.util.Comparator c)
c
- - the comparatorpublic MapList(boolean storeMap, boolean storeList)
storeMap
- - Specifies if data should be stored in the MapstoreList
- - Specifies if data should be stored in the Listpublic MapList(boolean storeMap, boolean storeList, java.util.Comparator c)
storeMap
- - Specifies if data should be stored in the MapstoreList
- - Specifies if data should be stored in the Listc
- - the comparatorpublic MapList(boolean storeMap, boolean storeList, java.util.Comparator c, int size)
storeMap
- - Specifies if data should be stored in the MapstoreList
- - Specifies if data should be stored in the Listc
- - the comparatorMethod Detail |
---|
public void Add(java.lang.String key, T element)
key
- - The key for the Hashtableelement
- - The element to addpublic void Add(long key, T element)
key
- - The key for the Hashtableelement
- - The element to addpublic T GetUsingKey(java.lang.String key)
key
- - The key of the element to retrieve
public T GetUsingKey(long key)
key
- - The key of the element to retrieve
public T GetUsingIndex(int index)
key
- - The key of the element to retrieve
public boolean ContainsKey(java.lang.String key)
key
- - The key of the desired element
public boolean ContainsKey(long key)
key
- - The key of the desired element
public int GetListSize()
public int GetMapSize()
public void Clear()
public boolean GetStoreMap()
public boolean GetStoreList()
public void SetStoreMap(boolean saveMap)
-
- the value of the storeMappublic void SetStoreList(boolean saveList)
-
- the value of the storeListpublic void Sort()
public java.lang.String GetListText()
public void CopyMapToList()
public void PrintList()
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |