@MinDoc(copyright="Copyright 2010 A. Weinert", author="Albrecht Weinert", version="see enclosing class CleverSSS", lastModified="see enclosing class CleverSSS", lastModifiedBy="see enclosing class CleverSSS", usage="make and use for optimistic substring search", purpose="make the searches implemented in (abstract) super class available if adequate") public static class CleverSSS.Simple extends CleverSSS
optimistic
cases are perfectly
handled in the abstract class CleverSSS
these cases are made
available hereby.loop in loop
search
algorithm and may so act as a reference implementation for all other
inheritors.enclosing class
CleverSSS.Simple
algName, ignoreCase, ignoreWS, len, mskMod, optimisticOK, primF, subC
Modifier | Constructor and Description |
---|---|
protected |
Simple(boolean ignoreCase,
boolean ignoreWS)
Constructor for the empty search sequence cases.
|
protected |
Simple(char[] subC,
boolean ignoreCase,
boolean ignoreWS,
boolean optimisticOK)
Constructor for superclass / factory use, no checks.
|
protected |
Simple(char subOne,
boolean ignoreCase,
boolean ignoreWS)
Constructor for the single character case.
|
Modifier and Type | Method and Description |
---|---|
protected long |
implAlgWhere(CharSequence sequ,
int lk,
int sI,
int mxSi)
The algorithmic implementation of whereImpl().
|
allWhere, asPair, asPairs, charAt, commonState, compareTo, endIndexOf, endIndexOf, equals, hashCode, implAlgWhere, indexOf, indexOf, lastIndexOf, lastIndexOf, lastWhereImpl, length, make, make, makeSimple, pair2long, state, subSequence, toCharA, toString, where, where, whereImpl
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
chars, codePoints
protected Simple(char subOne, boolean ignoreCase, boolean ignoreWS)
CleverSSS.ignoreWS
is true and subOne
is a space (<=' ')
this is considered as the empty sequence case.subOne
- single character search sequenceCleverSSS.ignoreCase
,
CleverSSS.ignoreWS
protected Simple(boolean ignoreCase, boolean ignoreWS)
ignoring
white space if so requested.CleverSSS.ignoreCase
,
CleverSSS.ignoreWS
protected Simple(char[] subC, boolean ignoreCase, boolean ignoreWS, boolean optimisticOK)
CleverSSS.optimisticOK
being forced to true regardless of the parameter
if subC
is null, empty or of length one.subC
- the sequence to search foroptimisticOK
- true for trivial (length <= 1) cases as well as
those where an optimistic O(n) left to right search is feasibleCleverSSS.ignoreCase
,
CleverSSS.ignoreWS
protected long implAlgWhere(CharSequence sequ, int lk, int sI, int mxSi)
CleverSSS.whereImpl(CharSequence, int, int)
does all parameter
checks and handles all exceptional / illegal cases by returning -1. It
also handles the optimistic
cases.String
with the extra of handling both ignore
case
and CleverSSS.ignoreWS
. By that
this is CleverSSS
's reference implementation for all its
inheritors.implAlgWhere
in class CleverSSS
sequ
- the sequence to search inlk
- its correct or shortened) lengthsI
- the starting index for the searchmxSi
- the maximum possible value of the match index