org.flexiblepower.ral.values
Q
- The quantity of the constraint (see the javax.measure package)public final class Constraint<Q extends javax.measure.quantity.Quantity> extends java.lang.Object
ConstraintList
.Constructor and Description |
---|
Constraint(double lowerBound,
double upperBound,
javax.measure.unit.Unit<Q> unit)
Construct a constraint with two (different) values.
|
Constraint(javax.measure.Measurable<Q> value)
Constructs a constraint with a single value.
|
Constraint(javax.measure.Measurable<Q> lowerBound,
javax.measure.Measurable<Q> upperBound)
Construct a constraint with a lower and upper bound expressed in the quantity.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj) |
javax.measure.Measurable<Q> |
getClosestValue(javax.measure.Measurable<Q> value) |
javax.measure.Measurable<Q> |
getLowerBound() |
javax.measure.Measurable<Q> |
getUpperBound() |
int |
hashCode() |
boolean |
isSingleValue() |
java.lang.String |
toString() |
public Constraint(javax.measure.Measurable<Q> lowerBound, javax.measure.Measurable<Q> upperBound)
lowerBound
- is the lower bound expressed in a unit that fits with QupperBound
- is the upper bound expressed in a unit that fits with Qjava.lang.NullPointerException
- if either the lower or upper bound is nulljava.lang.IllegalArgumentException
- if the upper bound is lower than the lower boundpublic Constraint(javax.measure.Measurable<Q> value)
value
- is the single typed input value.java.lang.NullPointerException
- if value is nullpublic Constraint(double lowerBound, double upperBound, javax.measure.unit.Unit<Q> unit)
lowerBound
- is the lower boundupperBound
- is the upper boundunit
- is unit in which both the lower and upper bound are expressedjava.lang.NullPointerException
- when unit is nullpublic boolean isSingleValue()
public javax.measure.Measurable<Q> getLowerBound()
public javax.measure.Measurable<Q> getUpperBound()
public javax.measure.Measurable<Q> getClosestValue(javax.measure.Measurable<Q> value)
value
- The value that we want to matchpublic int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object