Package org.apache.juneau.commons.lang
Class AsciiSet
java.lang.Object
org.apache.juneau.commons.lang.AsciiSet
Stores a set of ASCII characters for quick lookup.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionbooleancontains(char value) Returnstrue if the specified character is in this store.booleancontains(int value) Returnstrue if the specified character is in this store.booleancontains(CharSequence value) Returnstrue if the specified string contains at least one character in this set.booleancontainsOnly(String value) Returnstrue if the specified string contains only characters in this set.copy()Copies an existingAsciiSetso that you can augment it with additional values.static AsciiSet.Buildercreate()Creates a builder for an ASCII set.static AsciiSetCreates an ASCII set with the specified characters.
-
Method Details
-
create
Creates a builder for an ASCII set.- Returns:
- A new builder.
-
of
Creates an ASCII set with the specified characters.- Parameters:
value- The characters to keep in this store.- Returns:
- A new object.
-
contains
Returnstrue if the specified character is in this store.- Parameters:
value- The character to check.- Returns:
true if the specified character is in this store.
-
contains
Returnstrue if the specified string contains at least one character in this set.- Parameters:
value- The string to test.- Returns:
true if the string is not null and contains at least one character in this set.
-
contains
Returnstrue if the specified character is in this store.- Parameters:
value- The character to check.- Returns:
true if the specified character is in this store.
-
containsOnly
Returnstrue if the specified string contains only characters in this set.- Parameters:
value- The string to test.- Returns:
true if the string contains only characters in this set.
Nulls always returnfalse .
Blanks always returntrue .
-
copy
Copies an existingAsciiSetso that you can augment it with additional values.- Returns:
- A builder initialized to the same characters in the copied set.
-