Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.apache.xmlbeans.impl.regex
Class RangeToken  view RangeToken download RangeToken.java

java.lang.Object
  extended byorg.apache.xmlbeans.impl.regex.Token
      extended byorg.apache.xmlbeans.impl.regex.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.


Nested Class Summary
(package private) static class Token.CharToken
          This class represents a node in parse tree.
(package private) static class Token.ClosureToken
          This class represents a node in parse tree.
(package private) static class Token.ConcatToken
          This class represents a node in parse tree.
(package private) static class Token.ConditionToken
          (?(condition)yes-pattern|no-pattern)
(package private) static class Token.FixedStringContainer
           
(package private) static class Token.ModifierToken
          (ims-ims: ....
(package private) static class Token.ParenToken
          This class represents a node in parse tree.
(package private) static class Token.StringToken
          This class represents a node in parse tree.
(package private) static class Token.UnionToken
          This class represents a node in parse tree.
 
Field Summary
(package private) static int ANCHOR
           
(package private) static int BACKREFERENCE
           
(package private) static java.lang.String blockRanges
           
(package private) static int CHAR
           
(package private) static int CHAR_FINAL_QUOTE
           
(package private) static int CHAR_INIT_QUOTE
           
(package private) static int CHAR_LETTER
           
(package private) static int CHAR_MARK
           
(package private) static int CHAR_NUMBER
           
(package private) static int CHAR_OTHER
           
(package private) static int CHAR_PUNCTUATION
           
(package private) static int CHAR_SEPARATOR
           
(package private) static int CHAR_SYMBOL
           
(package private) static int CLOSURE
           
(package private)  boolean compacted
           
(package private) static int CONCAT
           
(package private) static int CONDITION
           
(package private) static boolean COUNTTOKENS
           
(package private) static int DOT
           
(package private) static int EMPTY
           
(package private) static int FC_ANY
           
(package private) static int FC_CONTINUE
           
(package private) static int FC_TERMINAL
           
(package private)  RangeToken icaseCache
           
(package private) static int INDEPENDENT
           
(package private) static int LOOKAHEAD
           
(package private) static int LOOKBEHIND
           
(package private)  int[] map
           
private static int MAPSIZE
           
(package private) static int MODIFIERGROUP
           
(package private) static int NEGATIVELOOKAHEAD
           
(package private) static int NEGATIVELOOKBEHIND
           
(package private) static int[] nonBMPBlockRanges
           
(package private) static int NONGREEDYCLOSURE
           
(package private)  int nonMapIndex
           
(package private) static java.util.Hashtable nonxs
           
(package private) static int NRANGE
           
(package private) static int PAREN
           
(package private) static int RANGE
           
(package private)  int[] ranges
           
(package private)  boolean sorted
           
(package private) static int STRING
           
(package private) static Token token_0to9
           
(package private) static Token token_dot
           
(package private) static Token token_empty
           
(package private) static Token token_linebeginning
           
(package private) static Token token_linebeginning2
           
(package private) static Token token_lineend
           
(package private) static Token token_not_0to9
           
(package private) static Token token_not_spaces
           
(package private) static Token token_not_wordchars
           
(package private) static Token token_not_wordedge
           
(package private) static Token token_spaces
           
(package private) static Token token_stringbeginning
           
(package private) static Token token_stringend
           
(package private) static Token token_stringend2
           
(package private) static Token token_wordbeginning
           
(package private) static Token token_wordchars
           
(package private) static Token token_wordedge
           
(package private) static Token token_wordend
           
(package private) static int tokens
           
(package private)  int type
           
(package private) static int UNION
           
(package private) static int UTF16_MAX
           
(package private) static java.lang.String viramaString
           
 
Constructor Summary
(package private) RangeToken(int type)
           
 
Method Summary
(package private)  void addChild(Token tok)
           
protected  void addRange(int start, int end)
           
(package private)  int analyzeFirstCharacter(RangeToken result, int options)
           
protected  void compactRanges()
          this.ranges is sorted.
(package private) static Token complementRanges(Token token)
          for RANGE: Creates complement.
(package private) static Token.StringToken createBackReference(int refno)
           
(package private) static Token.CharToken createChar(int ch)
           
(package private) static Token.ClosureToken createClosure(Token tok)
           
(package private) static Token.UnionToken createConcat()
           
(package private) static Token.ConcatToken createConcat(Token tok1, Token tok2)
           
(package private) static Token.ConditionToken createCondition(int refno, Token condition, Token yespat, Token nopat)
           
(package private) static Token createEmpty()
           
(package private) static Token.ParenToken createLook(int type, Token child)
           
private  void createMap()
           
(package private) static Token.ModifierToken createModifierGroup(Token child, int add, int mask)
           
(package private) static Token.ClosureToken createNGClosure(Token tok)
           
(package private) static RangeToken createNRange()
           
(package private) static Token.ParenToken createParen(Token child, int pnumber)
           
(package private) static RangeToken createRange()
           
(package private) static Token.StringToken createString(java.lang.String str)
           
(package private) static Token.UnionToken createUnion()
           
(package private)  void dumpRanges()
           
private static java.lang.String escapeCharInCharClass(int ch)
           
(package private)  void findFixedString(Token.FixedStringContainer container, int options)
           
(package private)  RangeToken getCaseInsensitiveToken()
           
(package private)  int getChar()
           
(package private)  Token getChild(int index)
           
(package private) static Token getCombiningCharacterSequence()
           
(package private) static Token getGraphemePattern()
           
(package private)  int getMax()
           
(package private)  int getMaxLength()
           
(package private)  int getMin()
           
(package private)  int getMinLength()
          How many characters are needed?
(package private)  int getParenNumber()
           
protected static RangeToken getRange(java.lang.String name, boolean positive)
           
protected static RangeToken getRange(java.lang.String name, boolean positive, boolean xs)
           
(package private)  int getReferenceNumber()
           
(package private)  java.lang.String getString()
           
protected  void intersectRanges(Token token)
           
private  boolean isCompacted()
           
protected static boolean isRegisterNonXS(java.lang.String name)
           
private  boolean isSorted()
           
(package private)  boolean match(int ch)
           
protected  void mergeRanges(Token token)
           
protected static void registerNonXS(java.lang.String name)
          This method is called by only getRange().
private  void setCompacted()
           
(package private)  void setMax(int max)
           
(package private)  void setMin(int min)
           
private  void setSorted(boolean sort)
           
(package private)  int size()
          A number of children.
protected  void sortRanges()
           
protected  void subtractRanges(Token token)
           
 java.lang.String toString()
          Convert this Object to a human-readable String.
 java.lang.String toString(int options)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

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

COUNTTOKENS

static final boolean COUNTTOKENS
See Also:
Constant Field Values

tokens

static int tokens

CHAR

static final int CHAR
See Also:
Constant Field Values

DOT

static final int DOT
See Also:
Constant Field Values

CONCAT

static final int CONCAT
See Also:
Constant Field Values

UNION

static final int UNION
See Also:
Constant Field Values

CLOSURE

static final int CLOSURE
See Also:
Constant Field Values

RANGE

static final int RANGE
See Also:
Constant Field Values

NRANGE

static final int NRANGE
See Also:
Constant Field Values

PAREN

static final int PAREN
See Also:
Constant Field Values

EMPTY

static final int EMPTY
See Also:
Constant Field Values

ANCHOR

static final int ANCHOR
See Also:
Constant Field Values

NONGREEDYCLOSURE

static final int NONGREEDYCLOSURE
See Also:
Constant Field Values

STRING

static final int STRING
See Also:
Constant Field Values

BACKREFERENCE

static final int BACKREFERENCE
See Also:
Constant Field Values

LOOKAHEAD

static final int LOOKAHEAD
See Also:
Constant Field Values

NEGATIVELOOKAHEAD

static final int NEGATIVELOOKAHEAD
See Also:
Constant Field Values

LOOKBEHIND

static final int LOOKBEHIND
See Also:
Constant Field Values

NEGATIVELOOKBEHIND

static final int NEGATIVELOOKBEHIND
See Also:
Constant Field Values

INDEPENDENT

static final int INDEPENDENT
See Also:
Constant Field Values

MODIFIERGROUP

static final int MODIFIERGROUP
See Also:
Constant Field Values

CONDITION

static final int CONDITION
See Also:
Constant Field Values

UTF16_MAX

static final int UTF16_MAX
See Also:
Constant Field Values

type

int type

token_dot

static Token token_dot

token_0to9

static Token token_0to9

token_wordchars

static Token token_wordchars

token_not_0to9

static Token token_not_0to9

token_not_wordchars

static Token token_not_wordchars

token_spaces

static Token token_spaces

token_not_spaces

static Token token_not_spaces

token_empty

static Token token_empty

token_linebeginning

static Token token_linebeginning

token_linebeginning2

static Token token_linebeginning2

token_lineend

static Token token_lineend

token_stringbeginning

static Token token_stringbeginning

token_stringend

static Token token_stringend

token_stringend2

static Token token_stringend2

token_wordedge

static Token token_wordedge

token_not_wordedge

static Token token_not_wordedge

token_wordbeginning

static Token token_wordbeginning

token_wordend

static Token token_wordend

FC_CONTINUE

static final int FC_CONTINUE
See Also:
Constant Field Values

FC_TERMINAL

static final int FC_TERMINAL
See Also:
Constant Field Values

FC_ANY

static final int FC_ANY
See Also:
Constant Field Values

CHAR_INIT_QUOTE

static final int CHAR_INIT_QUOTE
See Also:
Constant Field Values

CHAR_FINAL_QUOTE

static final int CHAR_FINAL_QUOTE
See Also:
Constant Field Values

CHAR_LETTER

static final int CHAR_LETTER
See Also:
Constant Field Values

CHAR_MARK

static final int CHAR_MARK
See Also:
Constant Field Values

CHAR_NUMBER

static final int CHAR_NUMBER
See Also:
Constant Field Values

CHAR_SEPARATOR

static final int CHAR_SEPARATOR
See Also:
Constant Field Values

CHAR_OTHER

static final int CHAR_OTHER
See Also:
Constant Field Values

CHAR_PUNCTUATION

static final int CHAR_PUNCTUATION
See Also:
Constant Field Values

CHAR_SYMBOL

static final int CHAR_SYMBOL
See Also:
Constant Field Values

blockRanges

static final java.lang.String blockRanges
See Also:
Constant Field Values

nonBMPBlockRanges

static final int[] nonBMPBlockRanges

nonxs

static java.util.Hashtable nonxs

viramaString

static final java.lang.String viramaString
See Also:
Constant Field Values
Constructor Detail

RangeToken

RangeToken(int type)
Method Detail

addRange

protected void addRange(int start,
                        int end)
Overrides:
addRange in class Token

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 class Token

compactRanges

protected void compactRanges()
this.ranges is sorted.

Overrides:
compactRanges in class Token

mergeRanges

protected void mergeRanges(Token token)
Overrides:
mergeRanges in class Token

subtractRanges

protected void subtractRanges(Token token)
Overrides:
subtractRanges in class Token

intersectRanges

protected void intersectRanges(Token token)
Overrides:
intersectRanges in class Token

complementRanges

static Token complementRanges(Token token)
for RANGE: Creates complement. for NRANGE: Creates the same meaning RANGE.


getCaseInsensitiveToken

RangeToken getCaseInsensitiveToken()

dumpRanges

void dumpRanges()

match

boolean match(int ch)
Overrides:
match in class Token

createMap

private void createMap()

toString

public java.lang.String toString(int options)
Overrides:
toString in class Token

escapeCharInCharClass

private static java.lang.String escapeCharInCharClass(int ch)

createLook

static Token.ParenToken createLook(int type,
                                   Token child)

createParen

static Token.ParenToken createParen(Token child,
                                    int pnumber)

createClosure

static Token.ClosureToken createClosure(Token tok)

createNGClosure

static Token.ClosureToken createNGClosure(Token tok)

createConcat

static Token.ConcatToken createConcat(Token tok1,
                                      Token tok2)

createConcat

static Token.UnionToken createConcat()

createUnion

static Token.UnionToken createUnion()

createEmpty

static Token createEmpty()

createRange

static RangeToken createRange()

createNRange

static RangeToken createNRange()

createChar

static Token.CharToken createChar(int ch)

createBackReference

static Token.StringToken createBackReference(int refno)

createString

static Token.StringToken createString(java.lang.String str)

createModifierGroup

static Token.ModifierToken createModifierGroup(Token child,
                                               int add,
                                               int mask)

createCondition

static Token.ConditionToken createCondition(int refno,
                                            Token condition,
                                            Token yespat,
                                            Token nopat)

size

int size()
A number of children.


getChild

Token getChild(int index)

addChild

void addChild(Token tok)

setMin

void setMin(int min)

setMax

void setMax(int max)

getMin

int getMin()

getMax

int getMax()

getReferenceNumber

int getReferenceNumber()

getString

java.lang.String getString()

getParenNumber

int getParenNumber()

getChar

int getChar()

toString

public java.lang.String toString()
Description copied from class: java.lang.Object
Convert this Object to a human-readable String. There are no limits placed on how long this String should be or what it should contain. We suggest you make it as intuitive as possible to be able to place it into System.out.println() 55 and such.

It is typical, but not required, to ensure that this method never completes abruptly with a java.lang.RuntimeException.

This method will be called when performing string concatenation with this object. If the result is null, string concatenation will instead use "null".

The default implementation returns getClass().getName() + "@" + Integer.toHexString(hashCode()).


getMinLength

final int getMinLength()
How many characters are needed?


getMaxLength

final int getMaxLength()

analyzeFirstCharacter

final int analyzeFirstCharacter(RangeToken result,
                                int options)

findFixedString

final void findFixedString(Token.FixedStringContainer container,
                           int options)

getRange

protected static RangeToken getRange(java.lang.String name,
                                     boolean positive)

getRange

protected static RangeToken getRange(java.lang.String name,
                                     boolean positive,
                                     boolean xs)

registerNonXS

protected static void registerNonXS(java.lang.String name)
This method is called by only getRange(). So this method need not MT-safe.


isRegisterNonXS

protected static boolean isRegisterNonXS(java.lang.String name)

getGraphemePattern

static Token getGraphemePattern()

getCombiningCharacterSequence

static Token getCombiningCharacterSequence()