Package net.sf.saxon.regex
Class SurrogateRegexTranslator.CharClass
- java.lang.Object
-
- net.sf.saxon.regex.SurrogateRegexTranslator.CharClass
-
- Direct Known Subclasses:
SurrogateRegexTranslator.BackReference
,SurrogateRegexTranslator.Complement
,SurrogateRegexTranslator.Dot
,SurrogateRegexTranslator.SimpleCharClass
- Enclosing class:
- SurrogateRegexTranslator
protected abstract static class SurrogateRegexTranslator.CharClass extends java.lang.Object
Object representing a character class
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
CharClass(int containsBmp, int containsNonBmp)
Create a character class
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
addNonBmpRanges(java.util.List ranges)
Add to a supplied List, ranges of non-BMP characters that are matched by this character class.int
getContainsBmp()
Determine whether this character class contains NONE, SOME, or ALL of the BMP charactersint
getContainsNonBmp()
Determine whether this character class contains NONE, SOME, or ALL of the non-BMP charactersint
getSingleChar()
If this character class contains a single character, get that charactervoid
output(FastStringBuffer buf)
Output a representation of this character class to the supplied bufferabstract void
outputBmp(FastStringBuffer buf)
Output a representation of the subset of this character class that's within the BMP, to a supplied bufferabstract void
outputComplementBmp(FastStringBuffer buf)
Output a representation of the complement of the subset of this character class that's within the BMP, to a supplied buffer
-
-
-
Constructor Detail
-
CharClass
protected CharClass(int containsBmp, int containsNonBmp)
Create a character class- Parameters:
containsBmp
- NONE, SOME, or ALL, depending on whether the character class contains all the BMP characters, some of the BMP characters, or none of the BMP characterscontainsNonBmp
- NONE, SOME, or ALL, depending on whether the character class contains all the non-BMP characters, some of the non-BMP characters, or none of the non-BMP characters
-
-
Method Detail
-
getContainsBmp
public int getContainsBmp()
Determine whether this character class contains NONE, SOME, or ALL of the BMP characters- Returns:
- NONE, SOME, or ALL
-
getContainsNonBmp
public int getContainsNonBmp()
Determine whether this character class contains NONE, SOME, or ALL of the non-BMP characters- Returns:
- NONE, SOME, or ALL
-
output
public final void output(FastStringBuffer buf)
Output a representation of this character class to the supplied buffer- Parameters:
buf
- the supplied buffer
-
outputBmp
public abstract void outputBmp(FastStringBuffer buf)
Output a representation of the subset of this character class that's within the BMP, to a supplied buffer- Parameters:
buf
- the supplied buffer
-
outputComplementBmp
public abstract void outputComplementBmp(FastStringBuffer buf)
Output a representation of the complement of the subset of this character class that's within the BMP, to a supplied buffer- Parameters:
buf
- the supplied buffer
-
getSingleChar
public int getSingleChar()
If this character class contains a single character, get that character- Returns:
- the single character matched by this character class, or -1 if it matches multiple characters
-
addNonBmpRanges
public void addNonBmpRanges(java.util.List ranges)
Add to a supplied List, ranges of non-BMP characters that are matched by this character class. Default implementation does nothing.- Parameters:
ranges
- a List to which this method will add zero or more Range objects denoting ranges of non-BMP characters
-
-