|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectuk.ac.starlink.util.MapGroup
public class MapGroup
Represents an ordered list of Map
s containing
related data.
The same keys may crop up in the maps comprising the groups, and
are taken to have the same meaning, so that all the values associated
with a given key in any of the maps in the group are taken to be
a related set. There is no requirement however that a key which
appears in one of the maps has to appear in any or all of the others.
A single list of the union of all the keys which appear in any
of the maps in the group can be obtained. An ordering may be
imposed on this list.
Constructor Summary | |
---|---|
MapGroup()
Constructs a new MapGroup. |
Method Summary | |
---|---|
void |
addMap(Map map)
Adds a new Map to the end of this group. |
List |
getKeyOrder()
Returns the list which defines ordering for any keys which crop up. |
List |
getKnownKeys()
Returns a list of all the keys which appear in any of the metadata sets. |
List |
getMaps()
Returns an unmodifiable list of all the maps in this group. |
void |
removeKey(Object key)
Removes all entries with a given key for every map in this group. |
void |
removeKeys(Collection keys)
Removes all entries which have a key in a given collection for every map in this group. |
void |
retainKeys(Collection keys)
Removes all entries except those with keys in a given collection for every map in this group. |
void |
setKeyOrder(List ordering)
Mandates an ordering to be imposed on the map keys. |
void |
setKnownKeys(List keys)
Sets the list of known keys. |
int |
size()
Returns the number of maps in this group. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MapGroup()
Method Detail |
---|
public void addMap(Map map)
map
- the map to addpublic List getMaps()
public int size()
public void setKeyOrder(List ordering)
getKnownKeys()
.
The supplied argument ordering is a list of objects;
an object which appears earlier in this list is considered to be
earlier in the list of MapGroup keys. Any which do not appear
in this list will be ranked in an unspecified order at the end
(their natural comparison order will be used if both objects
implement Comparable
).
ordering
- a list of objects which may appear in this
group's map keyspublic List getKeyOrder()
public void removeKeys(Collection keys)
keys
- the set of key values whose entries must be removedpublic void removeKey(Object key)
key
- the key whose entries must be removedpublic void retainKeys(Collection keys)
keys
- the keys whose entries must be retainedpublic void setKnownKeys(List keys)
getKnownKeys()
.
keys
- collection of keyspublic List getKnownKeys()
setKeyOrder(java.util.List)
. If it has never been called they will
be returned in an arbitrary order.
If setKnownKeys(java.util.List)
has been called with a non-null argument,
that list will be returned instead.
|
Copyright © 2004 CLRC: Central Laboratory of the Research Councils. All rights reserved. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |