Class CharRange
java.lang.Object
fc.util.Range
fc.util.CharRange
A range of characters.
Note, many methods in this particular class have the same signatures as in the apache commons.lang package but the implementation was strictly clean-room.
Thread Safety: This class is not thread safe in the face of any concurrent modification (via changing the start/end chars or union/intersection operations).
-
Constructor Summary
ConstructorsConstructorDescriptionCharRange(char start, char end) Constructs a character range between the specified start and end chars (both inclusive). -
Method Summary
Modifier and TypeMethodDescriptionchargetEnd()Get the end character for this character range.chargetStart()Get the start character for this character rangebooleaninRange(char c) Is the passed in character inside this rangestatic voidvoidsetEnd(char c) Sets the end character for this character rangevoidsetStart(char c) Set the start character for this character rangetoString()Output a string representation of the character rangeMethods inherited from class Range
isNegated, setNegated
-
Constructor Details
-
CharRange
Constructs a character range between the specified start and end chars (both inclusive).- Throws:
IllegalArgumentException- if the end char is lesser (via a < comparison) than the start char (equal to the start char is ok)
-
-
Method Details
-
getStart
Get the start character for this character range -
getEnd
Get the end character for this character range. -
inRange
Is the passed in character inside this range -
setEnd
Sets the end character for this character range- Parameters:
c- the end char- Throws:
IllegalArgumentException- if the end char is lesser (via a < comparison) than the current start char (equal to the start char is ok)
-
setStart
Set the start character for this character range- Throws:
IllegalArgumentException- if the start char is greater (via a > comparison) than the current end char (equal to the end char is ok)
-
toString
-
main
-