edu.ucsb.adl.middleware
Class Query.NumericConstraint
java.lang.Object
|
+--edu.ucsb.adl.middleware.Query.Constraint
|
+--edu.ucsb.adl.middleware.Query.SimpleConstraint
|
+--edu.ucsb.adl.middleware.Query.NumericConstraint
- Enclosing class:
- Query
- public static final class Query.NumericConstraint
- extends Query.SimpleConstraint
A numeric constraint.
|
Constructor Summary |
Query.NumericConstraint(java.lang.String bucket,
Query.Field field,
java.lang.String operator,
double value,
java.lang.String unit)
Constructs a NumericConstraint. |
|
Method Summary |
java.lang.String |
getUnit()
Returns the target value's unit of measure. |
double |
getValue()
Returns the target value. |
java.lang.String |
toHTML(java.lang.String mapServerURL)
Converts the constraint to HTML. |
java.lang.String |
toXML(int level)
Converts the constraint to XML. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Query.NumericConstraint
public Query.NumericConstraint(java.lang.String bucket,
Query.Field field,
java.lang.String operator,
double value,
java.lang.String unit)
- Constructs a
NumericConstraint.
- Parameters:
bucket - The bucket to constrain, e.g., "resolution".field - The field to constrain, or null.operator - The constraint operator, e.g., "equals".value - The target value.unit - The target value's unit of measure, e.g.,
"meters", or null.
- Throws:
java.lang.NullPointerException - If bucket or operator are
null.
getValue
public double getValue()
- Returns the target value.
- Returns:
- The target value.
getUnit
public java.lang.String getUnit()
- Returns the target value's unit of measure.
- Returns:
- The unit of measure or
null.
toHTML
public java.lang.String toHTML(java.lang.String mapServerURL)
- Converts the constraint to HTML.
- Specified by:
toHTML in class Query.Constraint
- Parameters:
mapServerURL - Unused.
- Returns:
- An HTML fragment consisting of a single
<li> element.
toXML
public java.lang.String toXML(int level)
- Converts the constraint to XML.
- Specified by:
toXML in class Query.Constraint
- Parameters:
level - The current indentation level; should be nonnegative.
- Returns:
- An XML fragment.