Package net.ontopia.utils
Class CharacterSet
java.lang.Object
net.ontopia.utils.CharacterSet
INTERNAL: Represents a set of Unicode characters, and provides a
method to quickly determine whether or not a particular character
is in the set. Useful for large, complex sets like "the set of XML
name start characters". Characters outside the BMP (ie: above
U+FFFF) are not supported.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddInterval(char low, char high) Adds the interval of characters to the set.voidclose()Called after the last interval has been added.booleancontains(char ch) Used to determine whether or not the character is a member of the set.
-
Constructor Details
-
CharacterSet
public CharacterSet()
-
-
Method Details
-
addInterval
public void addInterval(char low, char high) Adds the interval of characters to the set. To add a single character make low and high the same value. Cannot be called after close() has been called. -
close
public void close()Called after the last interval has been added. Compiles the internal, efficient representation of the set. No more additions can be made after this method has been called. -
contains
public boolean contains(char ch) Used to determine whether or not the character is a member of the set.
-