Package net.sf.saxon.regex.charclass
Class InverseCharacterClass
- java.lang.Object
-
- net.sf.saxon.regex.charclass.InverseCharacterClass
-
- All Implemented Interfaces:
java.util.function.IntPredicate,CharacterClass
public class InverseCharacterClass extends java.lang.Object implements CharacterClass
A character class represents a set of characters for regex matching purposes. An inverse character class is the complement of another character class
-
-
Constructor Summary
Constructors Constructor Description InverseCharacterClass(CharacterClass complement)Create the complement of a character class, that is, a character class containing exactly those characters that are not included in the supplied character class
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CharacterClassgetComplement()Get the character class of which this class is the complementIntSetgetIntSet()Get the set of matching characters if available.booleanisDisjoint(CharacterClass other)Ask whether this character class is known to be disjoint with another character class (that is, the two classes have no characters in common).booleantest(int value)
-
-
-
Constructor Detail
-
InverseCharacterClass
public InverseCharacterClass(CharacterClass complement)
Create the complement of a character class, that is, a character class containing exactly those characters that are not included in the supplied character class- Parameters:
complement- the class of which this one is the complement
-
-
Method Detail
-
getComplement
public CharacterClass getComplement()
Get the character class of which this class is the complement- Returns:
- the complement of this character class
-
test
public boolean test(int value)
- Specified by:
testin interfacejava.util.function.IntPredicate
-
isDisjoint
public boolean isDisjoint(CharacterClass other)
Description copied from interface:CharacterClassAsk whether this character class is known to be disjoint with another character class (that is, the two classes have no characters in common). If in doubt, return false.- Specified by:
isDisjointin interfaceCharacterClass- Parameters:
other- the other character class- Returns:
- true if the character classes are known to be disjoint; false if there may be characters in common between the two classes
-
getIntSet
public IntSet getIntSet()
Description copied from interface:CharacterClassGet the set of matching characters if available. If not available, return null- Specified by:
getIntSetin interfaceCharacterClass
-
-