gzz.util
Class InitialStringSearcher

java.lang.Object
  |
  +--gzz.util.InitialStringSearcher
All Implemented Interfaces:
StringSearcher

public class InitialStringSearcher
extends java.lang.Object
implements StringSearcher

Searches for strings having the parameter string as the initial substring. Initial, not terribly efficient implementation. Assumes that we will search for a few of the first characters.

Note that searching for a single character will return nothing. Searching for more than 6 characters will return the same as searching for the first 6 characters in that string.


Constructor Summary
InitialStringSearcher()
           
 
Method Summary
 void addString(java.lang.String s, java.lang.Object value)
           
 java.util.Collection search(java.lang.String s)
          Search for the given string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InitialStringSearcher

public InitialStringSearcher()
Method Detail

addString

public void addString(java.lang.String s,
                      java.lang.Object value)
Specified by:
addString in interface StringSearcher

search

public java.util.Collection search(java.lang.String s)
Description copied from interface: StringSearcher
Search for the given string. The returned collection may not be modified.

Specified by:
search in interface StringSearcher