|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object structure.CharSet
public class 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
,
BitSet
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. |
java.lang.Object |
clone()
Construct a duplicate of the character set. |
boolean |
contains(char c)
Detects whether c is a member of this set. |
java.lang.Object |
difference(CharSet other)
Computes the difference between this and other charset. |
boolean |
equals(java.lang.Object other)
Detect if two sets are equal. |
java.lang.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. |
java.lang.String |
toString()
Compute String representation of charset. |
java.lang.Object |
union(CharSet other)
Constructs a charset that is the union of this and other. |
Methods inherited from class java.lang.Object |
---|
getClass, hashCode, notify, notifyAll, wait, wait, wait |
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 java.lang.Object clone()
clone
in class java.lang.Object
public java.lang.Object union(CharSet other)
other
- The other character set.
public java.lang.Object intersection(CharSet other)
other
- The other character set.
public java.lang.Object difference(CharSet other)
other
- The other character set.
public boolean subset(CharSet other)
other
- The potential superset.public boolean isEmpty()
public boolean equals(java.lang.Object other)
equals
in class java.lang.Object
other
- The other set.
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |