|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.lmu.ifi.dbs.elki.utilities.optionhandling.constraints.StringLengthConstraint
public class StringLengthConstraint
Length constraint for a
StringParameter
.
Field Summary | |
---|---|
(package private) int |
maxlength
Maximum length |
(package private) int |
minlength
Minimum length |
Constructor Summary | |
---|---|
StringLengthConstraint(int minlength,
int maxlength)
Constructor with minimum and maximum length. |
Method Summary | |
---|---|
String |
getDescription(String parameterName)
Returns a description of this constraint. |
void |
test(String t)
Checks if the given string value of the string parameter is within the length restrictions. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
int minlength
int maxlength
Constructor Detail |
---|
public StringLengthConstraint(int minlength, int maxlength)
minlength
- Minimum length, may be 0 for no limitmaxlength
- Maximum length, may be -1 for no limitMethod Detail |
---|
public void test(String t) throws ParameterException
test
in interface ParameterConstraint<String>
t
- Value to be checked whether or not it fulfills the underlying
parameter constraint.
ParameterException
- if the parameter to be tested does not
fulfill the parameter constraintpublic String getDescription(String parameterName)
ParameterConstraint
getDescription
in interface ParameterConstraint<String>
parameterName
- the name of the parameter this constraint is used for
|
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |