IllegalValue
Constructor and Description |
---|
EnumRange(java.lang.Class<E> cls) |
EnumRange(java.lang.Class<E> cls,
E[] validEnums) |
Modifier and Type | Method and Description |
---|---|
E[] |
getValidEnums() |
java.lang.String |
getValidEnumsString() |
boolean |
isValid(java.lang.Object obj,
StringHolder errMsg)
Returns true if the specified object is valid for this Range,
and false otherwise.
|
static void |
main(java.lang.String[] args) |
void |
scan(ReaderTokenizer rtok,
java.lang.Object ref)
Scans this element from a ReaderTokenizer.
|
java.lang.String |
toString() |
void |
write(java.io.PrintWriter pw,
NumberFormat fmt,
java.lang.Object ref)
Writes a text description of this element to a PrintWriter.
|
public EnumRange(java.lang.Class<E> cls)
public E[] getValidEnums()
public java.lang.String getValidEnumsString()
public boolean isValid(java.lang.Object obj, StringHolder errMsg)
RangeBase
errMsg
is not null
, then errMsg.value
should
be set to a message describing why the object is not valid.public void scan(ReaderTokenizer rtok, java.lang.Object ref) throws java.io.IOException
write
.public 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 objectsjava.io.IOException
- if an I/O error occuredpublic java.lang.String toString()
toString
in class java.lang.Object
public static void main(java.lang.String[] args)