Class CharRangeSet
java.lang.Object
fc.util.CharRangeSet
A set of char ranges.
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs a new CharRangeSet with the initial set containing only the specified charrange -
Method Summary
Modifier and TypeMethodDescriptionbooleaninRange(char c) Consider a set of rangesA,Badded as a union (logicalor) and rangesCandDadded as an intersection (logicaland).voidAdds the specified range as an intersection to the existing ranges (for purposes ofinRange(char)method).static voidtoString()voidAdds this specified range as a union to the existing set of ranges (for purposes ofinRange(char)method).
-
Constructor Details
-
CharRangeSet
Constructs a new CharRangeSet with the initial set containing only the specified charrange- Parameters:
cs- the initial charrange
-
-
Method Details
-
union
Adds this specified range as a union to the existing set of ranges (for purposes ofinRange(char)method). Overlapping ranges are ok.- Parameters:
r- a charrange to unite with- Throws:
IllegalArgumentException- if the specified range was null
-
intersection
Adds the specified range as an intersection to the existing ranges (for purposes ofinRange(char)method). Overlapping ranges are ok.- Parameters:
r- the range to add
-
inRange
Consider a set of rangesA,Badded as a union (logicalor) and rangesCandDadded as an intersection (logicaland). A charactercis in range if it exists in:
This can be generalized to an arbitrary number of sub ranges. If intersection or union ranges don't exist, then they are not considered in the above expression. Note, the interaction may be subtle if any of the ranges ((A.inRange(c) || B.inRange(c) || ...) && C.inRange(c) && D.inRange(c) && ...A, B, C...etc) are individually negated because in that case the inRange method for that negated range would return true if the specified character was not in that range.- Returns:
trueif the passed in character is allowed by this set of ranges.
-
toString
-
main
-