public final class Characters extends Object
Modifier and Type | Field and Description |
---|---|
static Characters |
ALL
The Characters set including all character.
|
static Characters |
NONE
The empty Characters set
|
Modifier and Type | Method and Description |
---|---|
Characters |
add(char c)
Adds the given character to the set.
|
Characters |
add(Characters other)
Returns a new Characters object containing all the characters of this instance plus all characters of the
given instance.
|
static Characters |
allBut(char... chars)
Creates a new Characters instance containing all characters minus the given ones.
|
static Characters |
allBut(char c)
Creates a new Characters instance containing all characters minus the given one.
|
static Characters |
allBut(String chars)
Creates a new Characters instance containing all characters minus the given ones.
|
boolean |
contains(char c)
Determines whether this instance contains the given character.
|
boolean |
equals(Object o) |
char[] |
getChars()
Returns the characters in this set, if it is additive.
|
int |
hashCode() |
boolean |
isSubtractive() |
static Characters |
of(char... chars)
Creates a new Characters instance containing only the given chars.
|
static Characters |
of(char c)
Creates a new Characters instance containing only the given char.
|
static Characters |
of(String chars)
Creates a new Characters instance containing only the given chars.
|
Characters |
remove(char c)
Removes the given character from the set.
|
Characters |
remove(Characters other)
Returns a new Characters object containing all the characters of this instance minus all characters of the
given instance.
|
String |
toString() |
public static final Characters NONE
public static final Characters ALL
public boolean isSubtractive()
public char[] getChars()
public Characters add(char c)
c
- the character to addpublic Characters remove(char c)
c
- the character to removepublic boolean contains(char c)
c
- the character to check forpublic Characters add(Characters other)
other
- the other Characters to addpublic Characters remove(Characters other)
other
- the other Characters to removepublic static Characters of(char c)
c
- the charpublic static Characters of(char... chars)
chars
- the charspublic static Characters of(String chars)
chars
- the charspublic static Characters allBut(char c)
c
- the char to NOT includepublic static Characters allBut(char... chars)
chars
- the chars to NOT includepublic static Characters allBut(String chars)
chars
- the chars to NOT include