Class NodeMapper<T>
- java.lang.Object
-
- de.unirostock.sems.xmlutils.ds.mappers.NodeMapper<T>
-
- Type Parameters:
T- the generic type, e.g. TreeNode or DocumentNode
public class NodeMapper<T> extends Object
The Class NodeMapper maps Strings to nodes. Intended to map unique labels (e.g. node id => node). T is usually TreeNode or DocumentNode.- Author:
- Martin Scharm
- See Also:
TreeNode,DocumentNode,TextNode
-
-
Constructor Summary
Constructors Constructor Description NodeMapper()Instantiate a new mapper.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Set<String>getIds()Gets the known identifiers.TgetNode(String id)Gets a node that is stored for a certain identifier.voidputNode(String id, T node)Inserts a new node.voidrmNode(String id)Removes a node.StringtoString()
-
-
-
Method Detail
-
putNode
public void putNode(String id, T node)
Inserts a new node.- Parameters:
id- the identifiernode- the node
-
rmNode
public void rmNode(String id)
Removes a node.- Parameters:
id- the identifier
-
getNode
public T getNode(String id)
Gets a node that is stored for a certain identifier.- Parameters:
id- the identifier- Returns:
- the node
-
-