Package edu.uci.ics.jung.io.graphml
Class KeyMap
- java.lang.Object
-
- edu.uci.ics.jung.io.graphml.KeyMap
-
public class KeyMap extends java.lang.Object
A KeyMap is a storage mechanism for the keys read from the GraphML file. It stores the keys indexed by the type of GraphML metadata (node, edge, etc) that the key applies to. TheapplyKeys
method will obtain the list of keys that apply to the given metadata type and apply the keys one-by-one to the metadata.
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.Map<Metadata.MetadataType,java.util.List<Key>>
map
-
Constructor Summary
Constructors Constructor Description KeyMap()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addKey(Key key)
Adds the given key to the map.void
applyKeys(Metadata metadata)
Applies all keys that are applicable to the given metadata.void
clear()
Clears this map.java.util.Set<java.util.Map.Entry<Metadata.MetadataType,java.util.List<Key>>>
entrySet()
Retrieves the set of entries contained in this map.private java.util.List<Key>
getKeyList(Metadata.MetadataType type)
Gets the list for the given metadata type.
-
-
-
Field Detail
-
map
private final java.util.Map<Metadata.MetadataType,java.util.List<Key>> map
-
-
Method Detail
-
addKey
public void addKey(Key key)
Adds the given key to the map.- Parameters:
key
- the key to be added.
-
applyKeys
public void applyKeys(Metadata metadata)
Applies all keys that are applicable to the given metadata.- Parameters:
metadata
- the target metadata.
-
clear
public void clear()
Clears this map.
-
entrySet
public java.util.Set<java.util.Map.Entry<Metadata.MetadataType,java.util.List<Key>>> entrySet()
Retrieves the set of entries contained in this map.- Returns:
- all of the entries in this map.
-
getKeyList
private java.util.List<Key> getKeyList(Metadata.MetadataType type)
Gets the list for the given metadata type. If doesn't exist, the list is created.- Parameters:
type
- the metadata type.- Returns:
- the list for the metadata type.
-
-