|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.util.AbstractMap<K,V>
java.util.HashMap<key,Vector<vectorObject>>
org.cip4.jdflib.util.VectorMap<key,vectorObject>
key - the type used for the keyvectorObject - the type used for individual elements of each vector in the mappublic class VectorMap<key,vectorObject>
HashMap of multiple elements utility class
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class java.util.AbstractMap |
|---|
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V> |
| Constructor Summary | |
|---|---|
VectorMap()
null constructor |
|
| Method Summary | |
|---|---|
void |
appendUnique(key key,
Vector<vectorObject> vVal)
append a map, ensuring uniqueness |
void |
appendUnique(VectorMap<key,vectorObject> map)
append a VectorMap, ensuring uniqueness |
Vector<vectorObject> |
getAllValues()
get all values as one big vector, multiple entries are retained (see ContainerUtil.unify()) |
int |
getIndex(key key,
vectorObject singleObject)
get the index of singleObject in the vector of key |
Map<vectorObject,key> |
getInvertedMap()
get an inverted map that uses all entries a s keys and vice versa note that the behavior is undefined in case of multiple identical values |
vectorObject |
getOne(Object key,
int i)
get the value for key |
boolean |
isUnique()
Getter for bUnique attribute. |
void |
putOne(key key,
vectorObject val)
put the value for key, ensuring uniqueness |
void |
removeOne(key key,
vectorObject val)
remove the value for key,also remove key if the vector is empty |
void |
setOne(key key,
vectorObject newObj,
int pos)
insert the value for keyat position pos |
void |
setOne(key key,
vectorObject newObj,
vectorObject oldObj)
replace the value for key, add if oldObj==null or is not there |
void |
setUnique(boolean bUnique)
Setter for bUnique attribute. |
int |
size(key key)
get the size of the vector for key |
| Methods inherited from class java.util.HashMap |
|---|
clear, 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 |
| Constructor Detail |
|---|
public VectorMap()
| Method Detail |
|---|
public vectorObject getOne(Object key,
int i)
key - the search keyi - the index in the vecor matching key; if <0 count from the back of the vector
public int getIndex(key key,
vectorObject singleObject)
key - the key of the vectorsingleObject - the object to search
public int size(key key)
key - the key of the vector
public void putOne(key key,
vectorObject val)
key - the key of the vectorval - the vector element
public void appendUnique(key key,
Vector<vectorObject> vVal)
key - the key of the vectorvVal - the vector of elementspublic void appendUnique(VectorMap<key,vectorObject> map)
map - the map to addpublic Vector<vectorObject> getAllValues()
ContainerUtil.unify())
public Map<vectorObject,key> getInvertedMap()
public void removeOne(key key,
vectorObject val)
key - the key of the vectorval - the vector element
public void setOne(key key,
vectorObject newObj,
vectorObject oldObj)
key - the key of the vectornewObj - the new object to setoldObj - the old object to replace
public void setOne(key key,
vectorObject newObj,
int pos)
key - the key of the vectornewObj - the new object to setpos - the index in the vector, may be <0 to count from the end
IllegalArgumentException - if pos is negative and abs(pos)>size()public boolean isUnique()
public void setUnique(boolean bUnique)
bUnique - the bUnique to set
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||