|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.jstacs.parameters.validation.NumberValidator<E>
E - the subclass of Number to be validatedpublic class NumberValidator<E extends Comparable<? extends Number>>
Class that validates all subclasses of Number that implement
Comparable (e.g. Double, Long, Float) for compliance
with a specified lower and upper bound.
| Constructor Summary | |
|---|---|
NumberValidator(E lowerBound,
E upperBound)
Constructs a NumberValidator for a given upper and lower bound. |
|
NumberValidator(StringBuffer representation)
The standard constructor for the interface Storable. |
|
| Method Summary | |
|---|---|
boolean |
checkValue(Object value)
Returns true if the value is valid and false
otherwise. |
NumberValidator |
clone()
This method returns a deep copy of the current instance. |
void |
fromGalaxy(String namePrefix,
StringBuffer command)
Parses the contents of command in the format defined by configBuffer of GalaxyConvertible.toGalaxy(String, String, int, StringBuffer, StringBuffer)
and sets the values of the Parameter or ParameterSet accordingly. |
void |
fromXML(StringBuffer representation)
Parses a NumberValidator from the XML representation as returned
by toXML(). |
String |
getErrorMessage()
Returns the error message if ParameterValidator.checkValue(Object) returned false. |
E |
getLowerBound()
Returns the lower bound of the NumberValidator. |
void |
toGalaxy(String namePrefix,
String configPrefix,
int depth,
StringBuffer descBuffer,
StringBuffer configBuffer)
Creates an Galaxy XML-representation of the parameters and appends it to descBuffer
and variable configuration and appends it to configBuffer. |
String |
toString()
|
StringBuffer |
toXML()
This method returns an XML representation as StringBuffer of an
instance of the implementing class. |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public NumberValidator(E lowerBound,
E upperBound)
NumberValidator for a given upper and lower bound.
lowerBound - the lower boundupperBound - the upper boundpublic NumberValidator(StringBuffer representation)
throws NonParsableException
Storable.
Constructs a NumberValidator out of a XML representation.
representation - the XML representation as StringBuffer
NonParsableException - if the representation could not be parsed| Method Detail |
|---|
public NumberValidator clone()
ParameterValidator
clone in interface ParameterValidatorclone in class ObjectCloneablepublic E getLowerBound()
NumberValidator.
NumberValidatorpublic String getErrorMessage()
ParameterValidatorParameterValidator.checkValue(Object) returned false.
getErrorMessage in interface ParameterValidatorpublic boolean checkValue(Object value)
ParameterValidatortrue if the value is valid and false
otherwise.
checkValue in interface ParameterValidatorvalue - the Object to be checked
value is validpublic void fromXML(StringBuffer representation)
throws NonParsableException
NumberValidator from the XML representation as returned
by toXML().
representation - the XML representation
NonParsableException - if the XML code could not be parsedpublic StringBuffer toXML()
StorableStringBuffer of an
instance of the implementing class.
toXML in interface Storablepublic String toString()
toString in class Objectpublic void toGalaxy(String namePrefix,
String configPrefix,
int depth,
StringBuffer descBuffer,
StringBuffer configBuffer)
throws Exception
GalaxyConvertibledescBuffer
and variable configuration and appends it to configBuffer. The variable configuation
is also used to parse user-supplied values returned by Galaxy.
toGalaxy in interface GalaxyConvertiblenamePrefix - the prefix of the variable name used in GalaxyconfigPrefix - the prefix for conditionalsdepth - the depth in the parameter hierarchy, used for graphical representation of nestingdescBuffer - the buffer for the parameter descriptionconfigBuffer - the buffer for the configuration line
Exception - if the conversion failspublic void fromGalaxy(String namePrefix,
StringBuffer command)
throws Exception
GalaxyConvertiblecommand in the format defined by configBuffer of GalaxyConvertible.toGalaxy(String, String, int, StringBuffer, StringBuffer)
and sets the values of the Parameter or ParameterSet accordingly.
fromGalaxy in interface GalaxyConvertiblenamePrefix - the prefix of the variable namecommand - the command string
Exception - if the command string could not be parsed
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||