Package com.globalmentor.collections
Interface SuffixTree
-
- All Known Implementing Classes:
AbstractSuffixTree
,CharSequenceSuffixTree
public interface SuffixTree
A general interface for a suffix tree for a sequence of elements (most commonly characters).- Author:
- Garret Wilson
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
SuffixTree.Edge
Represents an edge between a parent node and a child node in a suffix tree.static interface
SuffixTree.Node
Represents a node in a suffix tree.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.Iterable<? extends SuffixTree.Edge>
getEdges()
SuffixTree.Node
getNode(int nodeIndex)
Retrieves the identified node.int
getNodeCount()
java.lang.Iterable<? extends SuffixTree.Node>
getNodes()
SuffixTree.Node
getRootNode()
Retrieves the root node of the tree.boolean
isExplicit()
-
-
-
Method Detail
-
isExplicit
boolean isExplicit()
- Returns:
- Whether the suffix tree is explicit, with every suffix ending on a leaf node.
-
getNodes
java.lang.Iterable<? extends SuffixTree.Node> getNodes()
- Returns:
- A read-only iterable of the nodes in the tree.
-
getNodeCount
int getNodeCount()
- Returns:
- The number of nodes in the suffix tree.
-
getRootNode
SuffixTree.Node getRootNode()
Retrieves the root node of the tree. This is a convenience method to retrieve the node with index zero.- Returns:
- The identified node.
-
getNode
SuffixTree.Node getNode(int nodeIndex)
Retrieves the identified node.- Parameters:
nodeIndex
- The index of the node to retrieve.- Returns:
- The identified node.
- Throws:
java.lang.IndexOutOfBoundsException
- if the given node index does not identify a node in this suffix tree.
-
getEdges
java.lang.Iterable<? extends SuffixTree.Edge> getEdges()
- Returns:
- A read-only iterable of edges in the tree.
-
-