org.jscience.linguistics.search
Class StringSearch.ReflectionDispatch

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

protected static class StringSearch.ReflectionDispatch
extends StringSearch.Dispatch

The ReflectionDispatch class is used if Reflection can be used to access the underlying char array in Strings to avoid the cloning overhead.


Method Summary
protected  char[] charsOf(java.lang.String s)
          Tries to return the underlying char array directly.
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)
Description copied from class: StringSearch.Dispatch
Searches a pattern inside a text, using the pre-processed Object and using the given StringSearch instance.

Overrides:
searchString in class StringSearch.Dispatch
Parameters:
text - DOCUMENT ME!
textStart - DOCUMENT ME!
textEnd - DOCUMENT ME!
pattern - DOCUMENT ME!
processed - DOCUMENT ME!
instance - DOCUMENT ME!
Returns:
DOCUMENT ME!
See Also:
StringSearch.Dispatch.searchString( String,int,int,String,Object,StringSearch)

searchString

protected int searchString(java.lang.String text,
                           int textStart,
                           int textEnd,
                           java.lang.String pattern,
                           StringSearch instance)
Description copied from class: StringSearch.Dispatch
Searches a pattern inside a text, using the given StringSearch instance.

Overrides:
searchString in class StringSearch.Dispatch
Parameters:
text - DOCUMENT ME!
textStart - DOCUMENT ME!
textEnd - DOCUMENT ME!
pattern - DOCUMENT ME!
instance - DOCUMENT ME!
Returns:
DOCUMENT ME!
See Also:
StringSearch.Dispatch.searchString( String,int,int,String,StringSearch)

searchString

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

Overrides:
searchString in class StringSearch.Dispatch
Parameters:
text - DOCUMENT ME!
textStart - DOCUMENT ME!
textEnd - DOCUMENT ME!
pattern - DOCUMENT ME!
k - DOCUMENT ME!
instance - DOCUMENT ME!
Returns:
DOCUMENT ME!
See Also:
StringSearch.Dispatch.searchString( String,int,int,String,int,MismatchSearch)

searchString

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

Overrides:
searchString in class StringSearch.Dispatch
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!
See Also:
StringSearch.Dispatch.searchString( String,int,int,String,Object,int,MismatchSearch)

charsOf

protected char[] charsOf(java.lang.String s)
Tries to return the underlying char array directly. Only works if the "offset" field is 0 and the "count" field is equal to the String's length.

Overrides:
charsOf in class StringSearch.Dispatch
Parameters:
s - the String, may not be null
Returns:
char[]
See Also:
org.jscience.linguistics.search.StringSearch.Dispatch#chars(java.lang.String)