Instances are immutable.
#ThreadSafe#
| Modifier and Type | Class and Description |
|---|---|
| private static class | CharRange.
Character |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv static final CharRange[] | EMPTY_ARRAY
Empty array. |
| private final char | end
The last character, inclusive, in the range. |
| private transient String | iToString
Cached toString. |
| private final boolean | negated
True if the range is everything except the characters specified. |
| private static final long | serialVersionUID
Required for serialization support. |
| private final char | start
The first character, inclusive, in the range. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | Returns: true if this range contains the input characterthe character to check ch)Is the character specified contained in this range. |
| public boolean | |
| public boolean | Returns: true if equalthe object to compare to obj)Overrides java. Compares two CharRange objects, returning true if they represent exactly the same range of characters defined in the same way. |
| public char | |
| public char | |
| public int | Returns: a suitable hashCodeOverrides java. Gets a hashCode compatible with the equals method. |
| public static CharRange | |
| public static CharRange | |
| public boolean | |
| public static CharRange | |
| public static CharRange | |
| public Iterator | Returns: an iterator to the chars represented by this rangeImplements java. Returns an iterator which can be used to walk through the characters described by this range. |
| public String | Returns: string representation of this rangeOverrides java. Gets a string representation of the character range. |
| EMPTY_ARRAY | back to summary |
|---|---|
| pack-priv static final CharRange[] EMPTY_ARRAY Empty array. | |
| end | back to summary |
|---|---|
| private final char end The last character, inclusive, in the range. | |
| iToString | back to summary |
|---|---|
| private transient String iToString Cached toString. | |
| negated | back to summary |
|---|---|
| private final boolean negated True if the range is everything except the characters specified. | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID Required for serialization support. Lang version 2.0.
| |
| start | back to summary |
|---|---|
| private final char start The first character, inclusive, in the range. | |
| CharRange | back to summary |
|---|---|
| private CharRange(char start, char end, final boolean negated) Constructs a A negated range includes everything except that defined by the start and end characters. If start and end are in the wrong order, they are reversed.
Thus
| |
| contains | back to summary |
|---|---|
| public boolean contains(final char ch) Is the character specified contained in this range.
| |
| contains | back to summary |
|---|---|
| public boolean contains(final CharRange range) Are all the characters of the passed in range contained in this range.
| |
| equals | back to summary |
|---|---|
| public boolean equals(final Object obj) Overrides java. Compares two CharRange objects, returning true if they represent exactly the same range of characters defined in the same way. | |
| getEnd | back to summary |
|---|---|
| public char getEnd() Gets the end character for this character range.
| |
| getStart | back to summary |
|---|---|
| public char getStart() Gets the start character for this character range.
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Gets a hashCode compatible with the equals method.
| |
| is | back to summary |
|---|---|
| public static CharRange is(final char ch) Constructs a
| |
| isIn | back to summary |
|---|---|
| public static CharRange isIn(final char start, final char end) Constructs a If start and end are in the wrong order, they are reversed.
Thus
| |
| isNegated | back to summary |
|---|---|
| public boolean isNegated() Is this A negated range includes everything except that defined by the start and end characters.
| |
| isNot | back to summary |
|---|---|
| public static CharRange isNot(final char ch) Constructs a negated A negated range includes everything except that defined by the single character.
| |
| isNotIn | back to summary |
|---|---|
| public static CharRange isNotIn(final char start, final char end) Constructs a negated A negated range includes everything except that defined by the start and end characters. If start and end are in the wrong order, they are reversed.
Thus
| |
| iterator | back to summary |
|---|---|
| public Iterator Implements java. Returns an iterator which can be used to walk through the characters described by this range. #NotThreadSafe# the iterator is not thread-safe | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Gets a string representation of the character range. | |
Iterator.
#NotThreadSafe#
| Modifier and Type | Field and Description |
|---|---|
| private char | current
The current character |
| private boolean | |
| private final CharRange |
| Access | Constructor and Description |
|---|---|
| private | CharacterIterator(final CharRange
The character range r)Constructs a new iterator for the character range. |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | Returns: true if the iterator has yet to reach the character dateImplements java. Has the iterator not reached the end character yet? |
| public Character | Returns: Character for the next characterImplements java. Returns the next character in the iteration |
| private void | |
| public void |
| current | back to summary |
|---|---|
| private char current The current character | |
| hasNext | back to summary |
|---|---|
| private boolean hasNext | |
| range | back to summary |
|---|---|
| private final CharRange range | |
| CharacterIterator | back to summary |
|---|---|
| private CharacterIterator(final CharRange r) Constructs a new iterator for the character range.
| |
| hasNext | back to summary |
|---|---|
| public boolean hasNext() Implements java. Has the iterator not reached the end character yet?
| |
| next | back to summary |
|---|---|
| public Character next() Implements java. Returns the next character in the iteration | |
| prepareNext | back to summary |
|---|---|
| private void prepareNext() Prepares the next character in the range. | |
| remove | back to summary |
|---|---|
| public void remove() Overrides default java. Always throws UnsupportedOperationException.
| |