ecologylab.collections
Class PrefixPhrase
java.lang.Object
ecologylab.generic.Debug
ecologylab.collections.PrefixPhrase
- Direct Known Subclasses:
- PrefixCollection
public class PrefixPhrase
- extends Debug
Recursive unit (bucket) for prefix pattern matching.
- Author:
- andruid
| Methods inherited from class ecologylab.generic.Debug |
classSimpleName, closeLoggingFile, debug, debug, debug, debug, debugA, debugA, debugA, debugI, debugI, debugI, error, error, getClassName, getClassName, getInteractive, getPackageName, getPackageName, getPackageName, initialize, level, level, level, logToFile, print, print, println, println, println, println, println, println, printlnA, printlnA, printlnA, printlnI, printlnI, printlnI, printlnI, setLoggingFile, show, show, superString, toggleInteractive, toString, toString, warning, warning, weird, weird |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
PrefixPhrase
public PrefixPhrase(PrefixPhrase parent,
java.lang.String phrase)
add
public PrefixPhrase add(java.lang.String string,
char separator)
add
protected PrefixPhrase add(java.lang.String string,
int start,
char separator)
match
public boolean match(java.lang.String string,
char separator)
match
protected boolean match(java.lang.String string,
int start,
char separator)
getPrefix
protected PrefixPhrase getPrefix(PrefixPhrase parent,
java.lang.String prefixPhrase)
- Seek the PrefixPhrase corresponding to the argument.
If it does not exist, return it.
If it does exist, does it have 0 children?
If so, return null. No need to insert for the argument's phrase.
If not, return it.
- Parameters:
prefixPhrase -
- Returns:
lookupChild
protected PrefixPhrase lookupChild(java.lang.String prefix)
clear
protected void clear()
toStringBuilder
public void toStringBuilder(java.lang.StringBuilder buffy,
char separator)
numChildren
public int numChildren()
isTerminal
public boolean isTerminal()
- Is the end of a prefix.
- Returns:
values
public java.util.ArrayList<java.lang.String> values(char separator)