Class 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 Detail

      • MultiNodeMapper

        public MultiNodeMapper()
        Instantiate a new mapper.
    • Method Detail

      • getIds

        public Set<String> getIds()
        Gets the known identifiers.
        Returns:
        the known identifiers
      • addNode

        public void addNode​(String id,
                            T node)
        Adds a node.
        Parameters:
        id - the identifier
        node - the node
      • rmNode

        public void rmNode​(String id,
                           T node)
        Removes a node.
        Parameters:
        id - the identifier
        node - 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