|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.opensha.commons.param.constraint.AbstractParameterConstraint<Estimate>
org.opensha.commons.param.constraint.impl.EstimateConstraint
public class EstimateConstraint
Title: DoubleEstimateConstraint.java
Description: A DoubleEstimateConstraint represents a range of allowed values between a min and max double value, inclusive and a list of allowed Estimate types. The main purpose of this class is to call isAllowed() which will return true if the value is an object of one of the allowed Estimate types and all the values are within the range specified here. See the DoubleConstraint javadocs for further documentation.
Copyright: Copyright (c) 2002
Company:
| Field Summary | |
|---|---|
protected StringConstraint |
allowedEstimateList
It contains a list of Strings specifying the classnames of allowed Estimates |
protected static String |
C
Class name for debugging. |
protected static boolean |
D
If true print out debug statements. |
protected Double |
max
The maximum value allowed in this constraint, inclusive |
protected Double |
min
The minimum value allowed in this constraint, inclusive |
| Fields inherited from class org.opensha.commons.param.constraint.AbstractParameterConstraint |
|---|
editable, name, nullAllowed |
| Constructor Summary | |
|---|---|
EstimateConstraint()
No-Arg Constructor, constraints are null so all values allowed and all estimate objects are allowed |
|
EstimateConstraint(ArrayList<String> allowedEstimateList)
Accepts a list of classnames of allowed estimate objects. |
|
EstimateConstraint(double min,
double max)
Accepts min/max values. |
|
EstimateConstraint(double min,
double max,
ArrayList allowedEstimateList)
Sets the min and max values, and a list of classnames of allowed estimate types in this constraint. |
|
EstimateConstraint(Double min,
Double max,
ArrayList<String> allowedEstimateList)
Sets the min and max values, and a list of classnames of allowed estimate types in this constraint. |
|
| Method Summary | |
|---|---|
Object |
clone()
Creates a copy of this object instance so the original cannot be altered. |
static ArrayList |
createConstraintForAllEstimates()
create constraint so that all estimates are allowed. |
static ArrayList |
createConstraintForDateEstimates()
Return a list of classnames which can be used to specify the date Estimate |
static ArrayList |
createConstraintForPositiveDoubleValues()
create constraint so that only postive double values are allowed. |
static ArrayList |
createConstraintForPositiveIntValues()
create constraint so that only postive int values are allowed. |
ArrayList |
getAllowedEstimateList()
Get a list of classnames of allowed estimates |
Double |
getMax()
Gets the max allowed value of this constraint |
Double |
getMin()
Returns the min allowed value of this constraint. |
boolean |
isAllowed(Estimate estimate)
This function first checks that estimate object is one of the allowed estimates. |
void |
setAllowedEstimateList(ArrayList<String> allowedEstimateList)
Set list of allowed Estimate classnames. |
String |
toString()
returns the classname of the constraint, and the min & max as a debug string |
| Methods inherited from class org.opensha.commons.param.constraint.AbstractParameterConstraint |
|---|
checkEditable, getName, isEditable, isNullAllowed, setName, setNonEditable, setNullAllowed |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected static final String C
protected static final boolean D
protected Double min
protected Double max
protected StringConstraint allowedEstimateList
| Constructor Detail |
|---|
public EstimateConstraint()
public EstimateConstraint(ArrayList<String> allowedEstimateList)
allowedEstimateList - List of classnames of allowed Estimate objects
public EstimateConstraint(double min,
double max)
min - max -
public EstimateConstraint(double min,
double max,
ArrayList allowedEstimateList)
min - The min value allowedmax - The max value allowedallowedEstimateList - List of classnames of allowed Estimate objects
public EstimateConstraint(Double min,
Double max,
ArrayList<String> allowedEstimateList)
min - The min value allowedmax - The max value allowedallowedEstimateList - List of classnames of allowed Estimate objects| Method Detail |
|---|
public void setAllowedEstimateList(ArrayList<String> allowedEstimateList)
throws EditableException
allowedEstimateList - object containing list of strings specfying classnames
of allowed estimates
EditableException - This exception is thrown if this constraint is
non-editable but user tries to call this functionpublic ArrayList getAllowedEstimateList()
public boolean isAllowed(Estimate estimate)
estimate -
public String toString()
toString in class Objectpublic Object clone()
clone in interface ParameterConstraint<Estimate>clone in class AbstractParameterConstraint<Estimate>public static ArrayList createConstraintForPositiveDoubleValues()
public static ArrayList createConstraintForPositiveIntValues()
public static ArrayList createConstraintForAllEstimates()
public static ArrayList createConstraintForDateEstimates()
public Double getMin()
public Double getMax()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||