Package net.ontopia.utils
Class CharacterSet
- java.lang.Object
-
- net.ontopia.utils.CharacterSet
-
public class CharacterSet extends Object
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 Constructor Description CharacterSet()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addInterval(char low, char high)
Adds the interval of characters to the set.void
close()
Called after the last interval has been added.boolean
contains(char ch)
Used to determine whether or not the character is a member of the set.
-
-
-
Method Detail
-
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.
-
-