public class CharacterBitSet extends Object
Constructor and Description |
---|
CharacterBitSet(String characters) |
Modifier and Type | Method and Description |
---|---|
BitSet |
bitSet()
Gets the underlying
BitSet object. |
String |
characters()
Gets the character list that was originally passed into this object.
|
boolean |
containsAny(String string)
Determines if the given string contains at least one of the characters in
this bit set.
|
boolean |
containsAny(String string,
int startIndex)
Determines if the given string contains at least one of the characters in
this bit set.
|
boolean |
containsOnly(String string)
Determines if the given string contains *only* the characters in this bit
set.
|
boolean |
containsOnly(String string,
int startIndex)
Determines if the given string contains *only* the characters in this bit
set.
|
boolean |
equals(Object obj) |
int |
hashCode() |
String |
toString() |
public CharacterBitSet(String characters)
characters
- the list of characters to check for. Ranges of
characters are represented using a hyphen. Therefore, to include a raw
hyphen in the character list, it must come at the very beginning or very
end of the given string. In this example, "a-f_:-", the following
characters are included in the final character list: lowercase letters a
through f, underscores, colons, and hyphenspublic String characters()
public boolean containsOnly(String string)
string
- the stringpublic boolean containsOnly(String string, int startIndex)
string
- the stringstartIndex
- the index to start at in the stringpublic boolean containsAny(String string)
string
- the stringpublic boolean containsAny(String string, int startIndex)
string
- the stringstartIndex
- the index to start at in the stringCopyright © 2012–2023 Michael Angstadt. All rights reserved.