|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.opensha.commons.param.constraint.AbstractParameterConstraint
org.opensha.commons.param.constraint.impl.DoubleValueWeightConstraint
public class DoubleValueWeightConstraint
DoubleValueWeightConstraint : This class accepts a ValueWeight object and checks whether both value and weight are within the allowed range of values.
| Field Summary | |
|---|---|
protected static String |
C
Class name for debugging. |
protected static boolean |
D
If true print out debug statements. |
protected DoubleConstraint |
valueConstraint
The value constraint |
protected DoubleConstraint |
weightConstraint
The value constraint |
| Fields inherited from class org.opensha.commons.param.constraint.AbstractParameterConstraint |
|---|
editable, name, nullAllowed |
| Constructor Summary | |
|---|---|
DoubleValueWeightConstraint()
No-Arg Constructor, constraints are null so all values allowed |
|
DoubleValueWeightConstraint(double minVal,
double maxVal,
double minWt,
double maxWt)
Constructor for the DoubleValueWeightConstraint object. |
|
DoubleValueWeightConstraint(Double minVal,
Double maxVal,
Double minWt,
Double maxWt)
Constructor for the DoubleValueWeightConstraint object. |
|
| Method Summary | |
|---|---|
Object |
clone()
Creates a copy of this object instance so the original cannot be altered. |
Double |
getMaxVal()
Gets the max allowed value of this constraint |
Double |
getMaxWt()
Gets the max allowed weight of this constraint |
Double |
getMinVal()
Returns the min allowed value of this constraint. |
Double |
getMinWt()
Returns the min allowed weight of this constraint. |
boolean |
isAllowed(double val,
double wt)
Checks if the passed in value and weight are within the min and max, inclusive of the end points. |
boolean |
isAllowed(Object obj)
Checks if the passed in value is within the min and max value and min and max weight, inclusive of the end points. |
boolean |
isAllowed(ValueWeight valueWt)
Checks if the passed in value is within the min and max, inclusive of the end points. |
void |
setMinMax(double minVal,
double maxVal,
double minWt,
double maxWt)
Sets the min and max values and min and max weights allowed in this constraint. |
void |
setMinMax(Double minVal,
Double maxVal,
Double minWt,
Double maxWt)
Sets the min and max values and min and max weights allowed in this constraint. |
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 DoubleConstraint valueConstraint
protected DoubleConstraint weightConstraint
| Constructor Detail |
|---|
public DoubleValueWeightConstraint()
public DoubleValueWeightConstraint(double minVal,
double maxVal,
double minWt,
double maxWt)
minVal - The min value allowedmaxVal - The max value allowedminWt - The min weight allowedmaxWt - The max weight allowed
public DoubleValueWeightConstraint(Double minVal,
Double maxVal,
Double minWt,
Double maxWt)
minVal - The min value allowedmaxVal - The max value allowedminWt - The min weight allowedmaxWt - The max weight allowed| Method Detail |
|---|
public void setMinMax(double minVal,
double maxVal,
double minWt,
double maxWt)
throws EditableException
minVal - The new min valuemaxVal - The new max valueminWt - The new min weightmaxWt - The new max weight
EditableException - Thrown when the constraint or parameter
containing this constraint has been made non-editable.
public void setMinMax(Double minVal,
Double maxVal,
Double minWt,
Double maxWt)
throws EditableException
minVal - The new min valuemaxVal - The new max valueminWt - The new min weightmaxWt - The new max weight
EditableException - Thrown when the constraint or parameter
containing this constraint has been made non-editable.public Double getMinVal()
public Double getMaxVal()
public Double getMinWt()
public Double getMaxWt()
public boolean isAllowed(Object obj)
obj - The object to check if allowed.
public boolean isAllowed(ValueWeight valueWt)
obj - The object to check if allowed.
public boolean isAllowed(double val,
double wt)
obj - The object to check if allowed.
public String toString()
toString in class Objectpublic Object clone()
clone in interface ParameterConstraintclone in class AbstractParameterConstraint
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||