net.ontopia.utils
Class CharacterSet

java.lang.Object
  extended by net.ontopia.utils.CharacterSet

public class CharacterSet
extends java.lang.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
CharacterSet()
           
 
Method Summary
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CharacterSet

public CharacterSet()
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.



Copyright © 2000-2012 Ontopia.