dk.brics.string.charset
Class CharSet

java.lang.Object
  extended by dk.brics.string.charset.CharSet
All Implemented Interfaces:
Cloneable

public class CharSet
extends Object
implements Cloneable

Character set.


Constructor Summary
CharSet()
          Constructs new empty character set.
CharSet(Automaton a)
          Returns new character set with all characters in strings in the given language.
CharSet(String s)
          Returns new character set with all characters in the specified string.
 
Method Summary
 CharSet add(char c)
          Constructs character set as this one but adds the given character.
 CharSet clone()
           
 boolean contains(char c)
          Checks whether a particular characters is in the set.
 boolean equals(Object obj)
           
 int hashCode()
           
 CharSet intersection(CharSet other)
          Constructs a new character set as the intersection of this set and the specified set.
static CharSet makeAnychars()
          Returns new character set with every character.
 CharSet remove(char c)
          Constructs character set as this one but removes the given character.
 Automaton toAutomaton()
          Constructs automaton accepting strings with zero or more characters from this set.
 CharSet toLowerCase()
          Constructs character set as this one and performs uppercase conversion of all characters.
 String toString()
           
 CharSet toUpperCase()
          Constructs character set as this one and performs lowercase conversion of all characters, as done by String.toUpperCase() (which occasionally differs from character-wise application of Character.toUpperCase(char))
 CharSet union(CharSet a)
          Constructs union of this character set and the given one.
static CharSet union(List<CharSet> c)
          Constructs union of the given character sets.
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CharSet

public CharSet()
Constructs new empty character set.


CharSet

public CharSet(Automaton a)
Returns new character set with all characters in strings in the given language.


CharSet

public CharSet(String s)
Returns new character set with all characters in the specified string.

Method Detail

add

public CharSet add(char c)
Constructs character set as this one but adds the given character.


clone

public CharSet clone()
Overrides:
clone in class Object

contains

public boolean contains(char c)
Checks whether a particular characters is in the set.


equals

public boolean equals(Object obj)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

intersection

public CharSet intersection(CharSet other)
Constructs a new character set as the intersection of this set and the specified set.


makeAnychars

public static CharSet makeAnychars()
Returns new character set with every character.


remove

public CharSet remove(char c)
Constructs character set as this one but removes the given character.


toAutomaton

public Automaton toAutomaton()
Constructs automaton accepting strings with zero or more characters from this set.


toLowerCase

public CharSet toLowerCase()
Constructs character set as this one and performs uppercase conversion of all characters.


toString

public String toString()
Overrides:
toString in class Object

toUpperCase

public CharSet toUpperCase()
Constructs character set as this one and performs lowercase conversion of all characters, as done by String.toUpperCase() (which occasionally differs from character-wise application of Character.toUpperCase(char))


union

public CharSet union(CharSet a)
Constructs union of this character set and the given one.


union

public static CharSet union(List<CharSet> c)
Constructs union of the given character sets.



Copyright © 2003-2009 Anders Møller, Aske Simon Christensen, Asger Feldthaus.