org.jscience.linguistics.search
Class StringSearch.Dispatch

java.lang.Object
  extended by org.jscience.linguistics.search.StringSearch.Dispatch
Direct Known Subclasses:
StringSearch.ReflectionDispatch
Enclosing class:
StringSearch

protected static class StringSearch.Dispatch
extends java.lang.Object

The Dispatch class implements the strategy to convert Strings to char arrays and calls the appropriate searchChars method in the given StringSearch instance.


Method Summary
protected  char[] charsOf(java.lang.String s)
          Returns the underlying char array.
protected  int[] searchString(java.lang.String text, int textStart, int textEnd, java.lang.String pattern, int k, MismatchSearch instance)
          Searches a pattern inside a text with at most k mismatches, using the given MismatchSearch instance.
protected  int[] searchString(java.lang.String text, int textStart, int textEnd, java.lang.String pattern, java.lang.Object processed, int k, MismatchSearch instance)
          Searches a pattern inside a text, using the pre-processed Object and at most k mismatches, using the given MismatchSearch instance.
protected  int searchString(java.lang.String text, int textStart, int textEnd, java.lang.String pattern, java.lang.Object processed, StringSearch instance)
          Searches a pattern inside a text, using the pre-processed Object and using the given StringSearch instance.
protected  int searchString(java.lang.String text, int textStart, int textEnd, java.lang.String pattern, StringSearch instance)
          Searches a pattern inside a text, using the given StringSearch instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

searchString

protected int searchString(java.lang.String text,
                           int textStart,
                           int textEnd,
                           java.lang.String pattern,
                           java.lang.Object processed,
                           StringSearch instance)
Searches a pattern inside a text, using the pre-processed Object and using the given StringSearch instance.

Parameters:
text - DOCUMENT ME!
textStart - DOCUMENT ME!
textEnd - DOCUMENT ME!
pattern - DOCUMENT ME!
processed - DOCUMENT ME!
instance - DOCUMENT ME!
Returns:
DOCUMENT ME!

searchString

protected int searchString(java.lang.String text,
                           int textStart,
                           int textEnd,
                           java.lang.String pattern,
                           StringSearch instance)
Searches a pattern inside a text, using the given StringSearch instance.

Parameters:
text - DOCUMENT ME!
textStart - DOCUMENT ME!
textEnd - DOCUMENT ME!
pattern - DOCUMENT ME!
instance - DOCUMENT ME!
Returns:
DOCUMENT ME!

searchString

protected int[] searchString(java.lang.String text,
                             int textStart,
                             int textEnd,
                             java.lang.String pattern,
                             int k,
                             MismatchSearch instance)
Searches a pattern inside a text with at most k mismatches, using the given MismatchSearch instance.

Parameters:
text - DOCUMENT ME!
textStart - DOCUMENT ME!
textEnd - DOCUMENT ME!
pattern - DOCUMENT ME!
k - DOCUMENT ME!
instance - DOCUMENT ME!
Returns:
DOCUMENT ME!

searchString

protected int[] searchString(java.lang.String text,
                             int textStart,
                             int textEnd,
                             java.lang.String pattern,
                             java.lang.Object processed,
                             int k,
                             MismatchSearch instance)
Searches a pattern inside a text, using the pre-processed Object and at most k mismatches, using the given MismatchSearch instance.

Parameters:
text - DOCUMENT ME!
textStart - DOCUMENT ME!
textEnd - DOCUMENT ME!
pattern - DOCUMENT ME!
processed - DOCUMENT ME!
k - DOCUMENT ME!
instance - DOCUMENT ME!
Returns:
DOCUMENT ME!

charsOf

protected char[] charsOf(java.lang.String s)
Returns the underlying char array.

Parameters:
s - the String, may not be null
Returns:
char[]