|
© 1998-2002 McGraw-Hill | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--structure.CharSet
Implementation of a set of characters whose ASCII values are between
0 and 255, inclusive. This set is specialized for use with characters.
It is implemented using the BitSet class. This class's interface
differs from the Set
, java.util.Bitset
,
and Set
interfaces, so care must be taken to
invoke the proper methods.
BitSet
,
java.util.BitSet
Field Summary | |
protected BitSet |
s
|
Constructor Summary | |
CharSet()
Constructs an empty charset. |
Method Summary | |
void |
add(char c)
Adds character c to set if not already there. |
void |
clear()
Removes the characters of the set. |
Object |
clone()
Construct a duplicate of the character set. |
boolean |
contains(char c)
Detects whether c is a member of this set. |
Object |
difference(CharSet other)
Computes the difference between this and other charset. |
boolean |
equals(Object other)
Detect if two sets are equal. |
Object |
intersection(CharSet other)
Computes the intersection of this charset and other. |
boolean |
isEmpty()
Detect an empty charset. |
void |
remove(char c)
Removes a character from set. |
boolean |
subset(CharSet other)
Detects if this set within the other. |
String |
toString()
Compute String representation of charset. |
Object |
union(CharSet other)
Constructs a charset that is the union of this and other. |
Methods inherited from class java.lang.Object |
|
Field Detail |
protected BitSet s
Constructor Detail |
public CharSet()
Method Detail |
public void add(char c)
c
- The character to be added to set.public void remove(char c)
c
- The character to be removed.public boolean contains(char c)
c
- The char sought.public void clear()
public Object clone()
clone
in class Object
public Object union(CharSet other)
other
- The other character set.public Object intersection(CharSet other)
other
- The other character set.public Object difference(CharSet other)
other
- The other character set.public boolean subset(CharSet other)
other
- The potential superset.public boolean isEmpty()
public boolean equals(Object other)
equals
in class Object
other
- The other set.public String toString()
toString
in class Object
|
© 1998-2002 McGraw-Hill | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |