maxLength16 = otherStringSpan.maxLength16;
someRelevant = otherStringSpan.someRelevant;
all = true;
- if (otherStringSpan.spanNotSet == otherStringSpan.spanSet) {
+ if (Utility.sameObjects(otherStringSpan.spanNotSet, otherStringSpan.spanSet)) {
spanNotSet = spanSet;
} else {
spanNotSet = (UnicodeSet) otherStringSpan.spanNotSet.clone();
/**
* Do the strings need to be checked in span() etc.?
- *
+ *
* @return true if strings need to be checked (call span() here),
* false if not (use a BMPSet for best performance).
*/
* so that a character span ends before any string.
*/
private void addToSpanNotSet(int c) {
- if (spanNotSet == null || spanNotSet == spanSet) {
+ if (Utility.sameObjects(spanNotSet, null) || Utility.sameObjects(spanNotSet, spanSet)) {
if (spanSet.contains(c)) {
return; // Nothing to do.
}
/*
* Algorithm for span(SpanCondition.CONTAINED)
- *
+ *
* Theoretical algorithm:
* - Iterate through the string, and at each code point boundary:
* + If the code point there is in the set, then remember to continue after it.
/*
* Algorithm for span(SIMPLE)
- *
+ *
* Theoretical algorithm:
* - Iterate through the string, and at each code point boundary:
* + If the code point there is in the set, then remember to continue after it.
*/
/**
* Spans a string.
- *
+ *
* @param s The string to be spanned
* @param start The start index that the span begins
* @param spanCondition The span condition
/**
* Span a string backwards.
- *
+ *
* @param s The string to be spanned
* @param spanCondition The span condition
* @return The string index which starts the span (i.e. inclusive).
/**
* Algorithm for spanNot()==span(SpanCondition.NOT_CONTAINED)
- *
+ *
* Theoretical algorithm:
* - Iterate through the string, and at each code point boundary:
* + If the code point there is in the set, then return with the current position.