|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjargs.gnu.validator.AbstractValidator<E>
jargs.gnu.validator.IntervalValidator<E>
public class IntervalValidator<E extends java.lang.Comparable<E>>
Simple validator that checks if a given Comparable is in the interval
of accepted values.
| Constructor Summary | |
|---|---|
IntervalValidator(E min,
E max)
Constructs an IntervalValidator. |
|
| Method Summary | |
|---|---|
E |
getMax()
Returns the maximum of the interval or null if no maximum
was defined. |
E |
getMin()
Returns the minimum of the interval or null if no minimum
was defined. |
java.lang.String |
toString()
|
boolean |
validate(E value)
Override to validate if an command-line option has a expected value. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public IntervalValidator(E min,
E max)
min - minimum of the intervalmax - maximum of the interval| Method Detail |
|---|
public E getMin()
null if no minimum
was defined.
public E getMax()
null if no maximum
was defined.
public boolean validate(E value)
AbstractValidator
validate in class AbstractValidator<E extends java.lang.Comparable<E>>value - The Value extracted via an command-line option.
true if the value was valid, else
false.public java.lang.String toString()
toString in class AbstractValidator<E extends java.lang.Comparable<E>>
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||