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) boolean
compacted
(package private) RangeToken
icaseCache
(package private) int[]
map
private static int
MAPSIZE
(package private) int
nonMapIndex
(package private) int[]
ranges
(package private) boolean
sorted
-
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 void
addRange(int start, int end)
protected void
compactRanges()
this.ranges is sorted.(package private) static Token
complementRanges(Token token)
for RANGE: Creates complement.private void
createMap()
(package private) void
dumpRanges()
private static java.lang.String
escapeCharInCharClass(int ch)
(package private) RangeToken
getCaseInsensitiveToken()
protected void
intersectRanges(Token token)
private boolean
isCompacted()
private boolean
isSorted()
(package private) boolean
match(int ch)
protected void
mergeRanges(Token token)
private void
setCompacted()
private void
setSorted(boolean sort)
protected void
sortRanges()
protected void
subtractRanges(Token token)
java.lang.String
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 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:
sortRanges
in classToken
-
compactRanges
protected void compactRanges()
this.ranges is sorted.- Overrides:
compactRanges
in classToken
-
mergeRanges
protected void mergeRanges(Token token)
- Overrides:
mergeRanges
in classToken
-
subtractRanges
protected void subtractRanges(Token token)
- Overrides:
subtractRanges
in classToken
-
intersectRanges
protected void intersectRanges(Token token)
- Overrides:
intersectRanges
in 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)
-
-