Class GenericUkkonenSuffixTree<T>
java.lang.Object
com.abstractkamen.datastructures.impl.trees.search.GenericUkkonenSuffixTree<T>
- Type Parameters:
T- type of value a match can return
- All Implemented Interfaces:
SuffixTree<T>
The Generic suffix tree implementation using Ukkonen's Algorithm
Useful links:
- Author:
- kamen.hristov
-
Constructor Summary
ConstructorsConstructorDescriptionThe only available constructor expects a list ofUkkonenSuffixTreeInputwithout any null values. -
Method Summary
Modifier and TypeMethodDescriptionbooleanTrue if the provided substring is present in the suffix tree.findAllOccurrences(String pattern) Returns the values for each string matching the provided pattern.intThe total nodes of this treeThis is purely for debugginginttextSize()The total size of the text held by this tree.toString()intTotal values inserted with their string keys into the tree.
-
Constructor Details
-
GenericUkkonenSuffixTree
The only available constructor expects a list ofUkkonenSuffixTreeInputwithout any null values.- Parameters:
input- list
-
-
Method Details
-
findAllOccurrences
Description copied from interface:SuffixTreeReturns the values for each string matching the provided pattern.- Specified by:
findAllOccurrencesin interfaceSuffixTree<T>- Parameters:
pattern- string- Returns:
- list of values
-
contains
Description copied from interface:SuffixTreeTrue if the provided substring is present in the suffix tree.- Specified by:
containsin interfaceSuffixTree<T>- Parameters:
pattern- string- Returns:
- true if present else false
-
textSize
public int textSize()Description copied from interface:SuffixTreeThe total size of the text held by this tree.- Specified by:
textSizein interfaceSuffixTree<T>- Returns:
- text size
-
nodesCount
public int nodesCount()Description copied from interface:SuffixTreeThe total nodes of this tree- Specified by:
nodesCountin interfaceSuffixTree<T>- Returns:
- node count
-
valuesCount
public int valuesCount()Description copied from interface:SuffixTreeTotal values inserted with their string keys into the tree.- Specified by:
valuesCountin interfaceSuffixTree<T>- Returns:
- value count
-
toString
-
prettyTreeString
This is purely for debugging- Returns:
- a string with the tree structure
-