Class CharSequenceSuffixTree.CharSequenceEdge

    • Constructor Detail

      • CharSequenceEdge

        public CharSequenceEdge​(CharSequenceSuffixTree.CharSequenceNode parentNode,
                                CharSequenceSuffixTree.CharSequenceNode childNode,
                                int start,
                                int end)
        Constructor.
        Parameters:
        parentNode - The parent node representing the root end of the edge.
        childNode - The child node representing the leaf end of the edge.
        start - The position of the start character, inclusive.
        end - The position of the end character, exclusive.
        Throws:
        java.lang.NullPointerException - if the given parent node and/or child node is null.
        java.lang.IllegalArgumentException - if the given end is less than the start.
    • Method Detail

      • getStart

        public int getStart()
        Specified by:
        getStart in interface SuffixTree.Edge
        Returns:
        The position of the start character, inclusive.
      • getEnd

        public int getEnd()
        Specified by:
        getEnd in interface SuffixTree.Edge
        Returns:
        The position of the last character, exclusive.
      • getLength

        public int getLength()
        Returns the length of the edge, i.e. end-start.
        Specified by:
        getLength in interface SuffixTree.Edge
        Returns:
        The number of characters on the edge.
      • isEmpty

        public boolean isEmpty()
        Specified by:
        isEmpty in interface SuffixTree.Edge
        Returns:
        true if this edge is empty and has no characters.
      • getSubSequence

        public java.lang.CharSequence getSubSequence()
        Returns:
        The subsequence of characters this edge represents.
      • startsWith

        public boolean startsWith​(java.lang.CharSequence charSequence)
        Compares a character sequence with the characters at the start of this child edge and continuing along child edges.
        Parameters:
        charSequence - The character sequence to compare.
        Returns:
        true if there is a path matching the given character sequence starting at this edge and continuing along child edges.
        See Also:
        CharSequenceSuffixTree.CharSequenceNode.startsWith(CharSequence)
      • startsWith

        public boolean startsWith​(java.lang.CharSequence charSequence,
                                  int start,
                                  int end)
        Compares part of a character sequence with the characters at the start of this child edge and continuing along child edges.
        Parameters:
        charSequence - The character sequence to compare.
        start - The start of the character sequence to compare, inclusive.
        end - The end of the character sequence to compare, exclusive.
        Returns:
        true if there is a path matching the given character sequence starting at this edge and continuing along child edges.
        Throws:
        java.lang.StringIndexOutOfBoundsException - if start or end are negative or greater than length(), or start is greater than end.
        See Also:
        CharSequenceSuffixTree.CharSequenceNode.startsWith(CharSequence, int, int)
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object