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:
java.io.Serializable
final class RangeToken extends Token implements java.io.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
Fields Modifier and Type Field Description (package private) booleancompacted(package private) RangeTokenicaseCache(package private) int[]mapprivate static intMAPSIZE(package private) intnonMapIndex(package private) int[]ranges(package private) booleansorted-
Fields 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 Constructor Description RangeToken(int type)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddRange(int start, int end)protected voidcompactRanges()this.ranges is sorted.(package private) static TokencomplementRanges(Token token)for RANGE: Creates complement.private voidcreateMap()(package private) voiddumpRanges()private static java.lang.StringescapeCharInCharClass(int ch)(package private) RangeTokengetCaseInsensitiveToken()protected voidintersectRanges(Token token)private booleanisCompacted()private booleanisSorted()(package private) booleanmatch(int ch)protected voidmergeRanges(Token token)private voidsetCompacted()private voidsetSorted(boolean sort)protected voidsortRanges()protected voidsubtractRanges(Token token)java.lang.StringtoString(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 Detail
-
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:
- Constant Field Values
-
-
Method Detail
-
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
protected void mergeRanges(Token token)
- Overrides:
mergeRangesin classToken
-
subtractRanges
protected void subtractRanges(Token token)
- Overrides:
subtractRangesin classToken
-
intersectRanges
protected void intersectRanges(Token token)
- Overrides:
intersectRangesin classToken- Parameters:
token- Ignore whether it is NRANGE or not.
-
complementRanges
static Token complementRanges(Token token)
for RANGE: Creates complement. for NRANGE: Creates the same meaning RANGE.
-
getCaseInsensitiveToken
RangeToken getCaseInsensitiveToken()
-
dumpRanges
void dumpRanges()
-
createMap
private void createMap()
-
escapeCharInCharClass
private static java.lang.String escapeCharInCharClass(int ch)
-
-