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