Package com.sun.msv.datatype.regexp
Class RangeToken
java.lang.Object
com.sun.msv.datatype.regexp.Token
com.sun.msv.datatype.regexp.RangeToken
- All Implemented Interfaces:
Serializable
This class represents a character class such as [a-z] or a period.
- Version:
- RangeToken.java,v 1.4 2002/08/09 15:18:17 neilg Exp
-
Nested Class Summary
Nested classes/interfaces inherited from class com.sun.msv.datatype.regexp.Token
Token.CharToken, Token.ClosureToken, Token.ConcatToken, Token.ConditionToken, Token.FixedStringContainer, Token.ModifierToken, Token.ParenToken, Token.StringToken, Token.UnionToken -
Field Summary
FieldsModifier and TypeFieldDescription(package private) boolean(package private) RangeToken(package private) int[]private static final int(package private) int(package private) int[](package private) booleanFields inherited from class com.sun.msv.datatype.regexp.Token
ANCHOR, BACKREFERENCE, blockRanges, CHAR, CHAR_FINAL_QUOTE, CHAR_INIT_QUOTE, CHAR_LETTER, CHAR_MARK, CHAR_NUMBER, CHAR_OTHER, CHAR_PUNCTUATION, CHAR_SEPARATOR, CHAR_SYMBOL, CLOSURE, CONCAT, CONDITION, COUNTTOKENS, DOT, EMPTY, FC_ANY, FC_CONTINUE, FC_TERMINAL, INDEPENDENT, LOOKAHEAD, LOOKBEHIND, MODIFIERGROUP, NEGATIVELOOKAHEAD, NEGATIVELOOKBEHIND, nonBMPBlockRanges, NONGREEDYCLOSURE, nonxs, NRANGE, PAREN, RANGE, STRING, token_0to9, token_dot, token_empty, token_linebeginning, token_linebeginning2, token_lineend, token_not_0to9, token_not_spaces, token_not_wordchars, token_not_wordedge, token_spaces, token_stringbeginning, token_stringend, token_stringend2, token_wordbeginning, token_wordchars, token_wordedge, token_wordend, tokens, type, UNION, UTF16_MAX, viramaString -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddRange(int start, int end) protected voidthis.ranges is sorted.(package private) static TokencomplementRanges(Token token) for RANGE: Creates complement.private void(package private) voidprivate static StringescapeCharInCharClass(int ch) (package private) RangeTokenprotected voidintersectRanges(Token token) private final booleanprivate final booleanisSorted()(package private) booleanmatch(int ch) protected voidmergeRanges(Token token) private final voidprivate final voidsetSorted(boolean sort) protected voidprotected voidsubtractRanges(Token token) toString(int options) Methods inherited from class com.sun.msv.datatype.regexp.Token
addChild, analyzeFirstCharacter, createBackReference, createChar, createClosure, createConcat, createConcat, createCondition, createEmpty, createLook, createModifierGroup, createNGClosure, createNRange, createParen, createRange, createString, createUnion, findFixedString, getChar, getChild, getCombiningCharacterSequence, getGraphemePattern, getMax, getMaxLength, getMin, getMinLength, getParenNumber, getRange, getRange, getReferenceNumber, getString, isRegisterNonXS, registerNonXS, setMax, setMin, size, toString
-
Field Details
-
ranges
int[] ranges -
sorted
boolean sorted -
compacted
boolean compacted -
icaseCache
RangeToken icaseCache -
map
int[] map -
nonMapIndex
int nonMapIndex -
MAPSIZE
private static final int MAPSIZE- See Also:
-
-
Constructor Details
-
RangeToken
RangeToken(int type)
-
-
Method Details
-
addRange
protected void addRange(int start, int end) -
isSorted
private final boolean isSorted() -
setSorted
private final void setSorted(boolean sort) -
isCompacted
private final boolean isCompacted() -
setCompacted
private final void setCompacted() -
sortRanges
protected void sortRanges()- Overrides:
sortRangesin classToken
-
compactRanges
protected void compactRanges()this.ranges is sorted.- Overrides:
compactRangesin classToken
-
mergeRanges
- Overrides:
mergeRangesin classToken
-
subtractRanges
- Overrides:
subtractRangesin classToken
-
intersectRanges
- Overrides:
intersectRangesin classToken- Parameters:
token- Ignore whether it is NRANGE or not.
-
complementRanges
for RANGE: Creates complement. for NRANGE: Creates the same meaning RANGE. -
getCaseInsensitiveToken
RangeToken getCaseInsensitiveToken() -
dumpRanges
void dumpRanges() -
match
boolean match(int ch) -
createMap
private void createMap() -
toString
-
escapeCharInCharClass
-