public final class AsciiSet
extends java.lang.Object
implements java.io.Serializable
This class is an internal implementation detail only intended for use within spectator. It is subject to change without notice.
Modifier and Type | Method and Description |
---|---|
static AsciiSet |
all()
Returns a set that matches all ascii characters.
|
java.util.Optional<java.lang.Character> |
character()
If this set matches a single character, then return an optional with that character.
|
boolean |
contains(char c)
Returns true if the character contained within the set.
|
boolean |
containsAll(java.lang.CharSequence str)
Returns true if all characters in the string are contained within the set.
|
static AsciiSet |
control()
Returns a set that matches ascii control characters.
|
AsciiSet |
diff(AsciiSet set)
Returns a new set that will match characters iff they are included this set and not in the
set that is provided.
|
boolean |
equals(java.lang.Object obj) |
static AsciiSet |
fromPattern(java.lang.String pattern)
Create a set containing ascii characters using a simple pattern.
|
int |
hashCode() |
AsciiSet |
intersection(AsciiSet set)
Returns a new set that will match characters iff they are included this set and in the
set that is provided.
|
AsciiSet |
invert()
Returns a new set that will match characters that are not included this set.
|
boolean |
isEmpty()
Returns true if this set is isEmpty.
|
static AsciiSet |
none()
Returns a set that matches no characters.
|
java.lang.String |
replaceNonMembers(java.lang.String input,
char replacement)
Replace all characters in the input string with the replacement character.
|
java.lang.String |
toString() |
AsciiSet |
union(AsciiSet set)
Returns a new set that will match characters either in the this set or in the
set that is provided.
|
public static AsciiSet fromPattern(java.lang.String pattern)
ABC
would contain the characters
A
, B
, and C
. Ranges are supported so all uppercase letters could
be specified as A-Z
. The dash, -
, will be included as part of the set if
it is at the start or end of the pattern.pattern
- String specification of the character set.pattern
.public static AsciiSet none()
public static AsciiSet all()
public static AsciiSet control()
public boolean contains(char c)
public boolean containsAll(java.lang.CharSequence str)
public java.lang.String replaceNonMembers(java.lang.String input, char replacement)
public AsciiSet union(AsciiSet set)
public AsciiSet intersection(AsciiSet set)
public AsciiSet diff(AsciiSet set)
public AsciiSet invert()
public java.util.Optional<java.lang.Character> character()
public boolean isEmpty()
public java.lang.String toString()
toString
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object