|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectmaspack.util.RangeBase
maspack.util.NumericIntervalRange
public class NumericIntervalRange
A base class for creating Range objects.
Field Summary |
---|
Fields inherited from interface maspack.util.Range |
---|
IllegalValue |
Constructor Summary | |
---|---|
NumericIntervalRange()
|
|
NumericIntervalRange(NumericInterval maxRange)
|
Method Summary | |
---|---|
NumericIntervalRange |
clone()
|
void |
intersect(Range r)
Intersects the set of valid values of this Range with those of another. |
boolean |
isEmpty()
Returns true if this range is empty - i.e., if there are no valid values. |
boolean |
isValid(java.lang.Object obj,
StringHolder errMsg)
Returns true if the specified object is valid for this Range, and false otherwise. |
void |
scan(ReaderTokenizer rtok,
java.lang.Object ref)
Scans this element from a ReaderTokenizer. |
void |
write(java.io.PrintWriter pw,
NumberFormat fmt,
java.lang.Object ref)
Writes a text description of this element to a PrintWriter. |
Methods inherited from class maspack.util.RangeBase |
---|
isWritable, makeValid, setError |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public NumericIntervalRange()
public NumericIntervalRange(NumericInterval maxRange)
Method Detail |
---|
public boolean isValid(java.lang.Object obj, StringHolder errMsg)
errMsg
is not null
, then errMsg.value
should
be set to a message describing why the object is not valid.
isValid
in interface Range
isValid
in class RangeBase
obj
- Object to be testeserrMsg
- Optional handle for storing error message
public boolean isEmpty()
isEmpty
in interface Range
isEmpty
in class RangeBase
public void intersect(Range r)
Range.isEmpty()
should subsequently return true
.
intersect
in interface Range
intersect
in class RangeBase
r
- range to intersect with.public void scan(ReaderTokenizer rtok, java.lang.Object ref) throws java.io.IOException
write
.
scan
in interface Scannable
scan
in class RangeBase
rtok
- Tokenizer from which to scan the elementref
- optional reference object which can be used for resolving references to
other objects
java.io.IOException
- if an I/O or formatting error occuredpublic void write(java.io.PrintWriter pw, NumberFormat fmt, java.lang.Object ref) throws java.io.IOException
scan
and complete
enough to allow full reconstruction of the element.
write
in interface Scannable
write
in class RangeBase
pw
- stream for writing the elementfmt
- numeric formating informationref
- optional reference object which can be used for producing references to
other objects
java.io.IOException
- if an I/O error occuredpublic NumericIntervalRange clone()
clone
in interface Clonable
clone
in class RangeBase
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |