Class AuthorNodeUtil


  • @API(type=NOT_EXTENDABLE,
         src=PUBLIC)
    public class AuthorNodeUtil
    extends java.lang.Object
    Utility functions for working with AuthorNodes.
    Since:
    15.2
    • Field Detail

      • ATTRIBUTE_VALUE_MARKER

        public static final java.lang.String ATTRIBUTE_VALUE_MARKER
        Marker used to find a certain element
        See Also:
        Constant Field Values
    • Constructor Detail

      • AuthorNodeUtil

        public AuthorNodeUtil()
    • Method Detail

      • minimizeAuthorCollection

        public static java.util.List<AuthorNode> minimizeAuthorCollection​(java.util.Collection<? extends AuthorNode> collection)
        Remove from the collection of nodes any descendants so the only nodes that are kept are disjunct.
        Parameters:
        collection - A collection of nodes.
        Returns:
        A list of disjunct nodes.
      • getFirstLeaf

        public static AuthorNode getFirstLeaf​(AuthorDocumentFragment fragment)
        Finds the first leaf node in the document fragment.
        Parameters:
        fragment - The document fragment.
        Returns:
        The first leaf.
      • getFirstChildElement

        public static AuthorElement getFirstChildElement​(AuthorParentNode parentNode)
        Return the first child element.
        Parameters:
        parentNode - The parent element.
        Returns:
        the first child element.
      • getChildIndex

        public static int getChildIndex​(int offset,
                                        java.util.List<AuthorNode> children)
        Looks for the child that contains the given offset.
        Parameters:
        offset - Searched offset.
        children - The list of children.
        Returns:
        The index of the child in the list of children or -1 if not found.