|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.googlecode.concurrenttrees.solver.LCSubstringSolver
public class LCSubstringSolver
Finds the longest common substring in a collection of documents. See Longest common substring problem.
This class internally extendsConcurrentRadixTree and combines it with elements from
ConcurrentSuffixTree, but implements its own traversal algorithm.
| Constructor Summary | |
|---|---|
LCSubstringSolver(NodeFactory nodeFactory)
Creates a new LCSubstringSolver which will use the given NodeFactory to create nodes. |
|
LCSubstringSolver(NodeFactory nodeFactory,
boolean restrictConcurrency)
Creates a new LCSubstringSolver which will use the given NodeFactory to create nodes. |
|
| Method Summary | |
|---|---|
boolean |
add(CharSequence document)
Adds a CharSequence document to the solver. |
protected Set<String> |
createSetForOriginalKeys()
|
CharSequence |
getLongestCommonSubstring()
Finds the longest common substring in the documents added to the solver so far. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public LCSubstringSolver(NodeFactory nodeFactory)
LCSubstringSolver which will use the given NodeFactory to create nodes.
nodeFactory - An object which creates Node objects
on-demand, and which might return node implementations optimized for storing the values supplied to it for
the creation of each node
public LCSubstringSolver(NodeFactory nodeFactory,
boolean restrictConcurrency)
LCSubstringSolver which will use the given NodeFactory to create nodes.
nodeFactory - An object which creates Node objects
on-demand, and which might return node implementations optimized for storing the values supplied to it for the
creation of each noderestrictConcurrency - If true, configures use of a ReadWriteLock allowing
concurrent reads, except when writes are being performed by other threads, in which case writes block all reads;
if false, configures lock-free reads; allows concurrent non-blocking reads, even if writes are being performed
by other threads| Method Detail |
|---|
public boolean add(CharSequence document)
CharSequence document to the solver.
document - The CharSequence to add to the solver
public CharSequence getLongestCommonSubstring()
protected Set<String> createSetForOriginalKeys()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||