public class UnicodeSetStringSpan extends Object
| Modifier and Type | Field and Description |
|---|---|
static int |
ALL |
static int |
BACK |
static int |
BACK_UTF16_CONTAINED |
static int |
BACK_UTF16_NOT_CONTAINED |
static int |
CONTAINED |
static int |
FWD |
static int |
FWD_UTF16_CONTAINED |
static int |
FWD_UTF16_NOT_CONTAINED |
static int |
NOT_CONTAINED |
static int |
WITH_COUNT |
| Constructor and Description |
|---|
UnicodeSetStringSpan(UnicodeSet set,
ArrayList<String> setStrings,
int which)
Constructs for all variants of span(), or only for any one variant.
|
UnicodeSetStringSpan(UnicodeSetStringSpan otherStringSpan,
ArrayList<String> newParentSetStrings)
Constructs a copy of an existing UnicodeSetStringSpan.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
contains(int c)
For fast UnicodeSet::contains(c).
|
boolean |
needsStringSpanUTF16()
Do the strings need to be checked in span() etc.?
|
int |
span(CharSequence s,
int start,
UnicodeSet.SpanCondition spanCondition)
Spans a string.
|
int |
spanAndCount(CharSequence s,
int start,
UnicodeSet.SpanCondition spanCondition,
OutputInt outCount)
Spans a string and counts the smallest number of set elements on any path across the span.
|
int |
spanBack(CharSequence s,
int length,
UnicodeSet.SpanCondition spanCondition)
Span a string backwards.
|
public static final int WITH_COUNT
public static final int FWD
public static final int BACK
public static final int CONTAINED
public static final int NOT_CONTAINED
public static final int ALL
public static final int FWD_UTF16_CONTAINED
public static final int FWD_UTF16_NOT_CONTAINED
public static final int BACK_UTF16_CONTAINED
public static final int BACK_UTF16_NOT_CONTAINED
public UnicodeSetStringSpan(UnicodeSet set, ArrayList<String> setStrings, int which)
public UnicodeSetStringSpan(UnicodeSetStringSpan otherStringSpan, ArrayList<String> newParentSetStrings)
public boolean needsStringSpanUTF16()
public boolean contains(int c)
public int span(CharSequence s, int start, UnicodeSet.SpanCondition spanCondition)
s - The string to be spannedstart - The start index that the span beginsspanCondition - The span conditionpublic int spanAndCount(CharSequence s, int start, UnicodeSet.SpanCondition spanCondition, OutputInt outCount)
For proper counting, we cannot ignore strings that are fully contained in code point spans.
If the set does not have any fully-contained strings, then we could optimize this like span(), but such sets are likely rare, and this is at least still linear.
s - The string to be spannedstart - The start index that the span beginsspanCondition - The span conditionoutCount - The countpublic int spanBack(CharSequence s, int length, UnicodeSet.SpanCondition spanCondition)
s - The string to be spannedspanCondition - The span condition