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
Modifier and TypeInterfaceDescriptionstatic interface
Represents an edge between a parent node and a child node in a suffix tree.static interface
Represents a node in a suffix tree. -
Method Summary
Modifier and TypeMethodDescriptionIterable<? extends SuffixTree.Edge>
getEdges()
getNode
(int nodeIndex) Retrieves the identified node.int
Iterable<? extends SuffixTree.Node>
getNodes()
Retrieves the root node of the tree.boolean
-
Method Details
-
isExplicit
boolean isExplicit()- Returns:
- Whether the suffix tree is explicit, with every suffix ending on a leaf node.
-
getNodes
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
Retrieves the identified node.- Parameters:
nodeIndex
- The index of the node to retrieve.- Returns:
- The identified node.
- Throws:
IndexOutOfBoundsException
- if the given node index does not identify a node in this suffix tree.
-
getEdges
Iterable<? extends SuffixTree.Edge> getEdges()- Returns:
- A read-only iterable of edges in the tree.
-