|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectfc.util.CharRangeSet
public class CharRangeSet
A set of char ranges.
Constructor Summary | |
---|---|
CharRangeSet(CharRange cs)
Constructs a new CharRangeSet with the initial set containing only the specified charrange |
Method Summary | |
---|---|
boolean |
inRange(char c)
Consider a set of ranges A, B added as a union (logical or) and ranges C and D added as an intersection (logical and). |
void |
intersection(CharRange r)
Adds the specified range as an intersection to the existing ranges (for purposes of inRange(char) method). |
static void |
main(java.lang.String[] args)
|
java.lang.String |
toString()
|
void |
union(CharRange r)
Adds this specified range as a union to the existing set of ranges (for purposes of inRange(char) method). |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public CharRangeSet(CharRange cs)
cs
- the initial charrangeMethod Detail |
---|
public void union(CharRange r)
inRange(char)
method).
Overlapping ranges are ok.
cs
- a charrange to unite with
java.lang.IllegalArgumentException
- if the specified range was nullpublic void intersection(CharRange r)
inRange(char)
method).
Overlapping ranges are ok.
r
- the range to addpublic boolean inRange(char c)
(A.inRange(c) || B.inRange(c) || ...) && C.inRange(c) && D.inRange(c) && ...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, 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.
public java.lang.String toString()
toString
in class java.lang.Object
public static void main(java.lang.String[] args)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |