org.apache.commons.lang
Class CharSet

java.lang.Object
  |
  +--org.apache.commons.lang.CharSet

public class CharSet
extends Object

A set of characters. You can iterate over the characters in the set.

Version:
$Id: CharSet.java,v 1.4 2002/09/29 08:20:52 bayard Exp $
Author:
Henri Yandell, Stephen Colebourne

Field Summary
private  LinkedList set
           
 
Constructor Summary
protected CharSet(String[] set)
          Restricted constructor.
 
Method Summary
protected  void add(String str)
          Add a set definition string to the set
 boolean contains(char ch)
          Does the set contain the character specified
 String toString()
          Returns a string representation of the set
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

set

private LinkedList set
Constructor Detail

CharSet

protected CharSet(String[] set)
Restricted constructor. Use the factory method evaluateSet().

Throws:
NullPointerException - if any of set[i] is null or if set is null
Method Detail

contains

public boolean contains(char ch)
Does the set contain the character specified

Parameters:
ch - the character to check for
Returns:
true if it does contain it

add

protected void add(String str)
Add a set definition string to the set

Parameters:
str - set definition string
Throws:
NullPointerException - if str is null

toString

public String toString()
Returns a string representation of the set

Overrides:
toString in class Object
Returns:
string representation


Copyright (c) 2001-2002 - Apache Software Foundation