edu.ucsb.adl.middleware
Class Query.TemporalConstraint

java.lang.Object
  |
  +--edu.ucsb.adl.middleware.Query.Constraint
        |
        +--edu.ucsb.adl.middleware.Query.SimpleConstraint
              |
              +--edu.ucsb.adl.middleware.Query.TemporalConstraint
Enclosing class:
Query

public static final class Query.TemporalConstraint
extends Query.SimpleConstraint

A temporal constraint.


Field Summary
 
Fields inherited from class edu.ucsb.adl.middleware.Query.SimpleConstraint
m_bucket, m_field, m_operator
 
Fields inherited from class edu.ucsb.adl.middleware.Query.Constraint
m_parent
 
Constructor Summary
Query.TemporalConstraint(java.lang.String bucket, Query.Field field, java.lang.String operator, int begin, int end)
          Constructs a TemporalConstraint.
 
Method Summary
 int getBegin()
          Returns the target range begin date.
 int getEnd()
          Returns the target range end date.
 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 edu.ucsb.adl.middleware.Query.SimpleConstraint
commonFieldsToXML, getBucket, getField, getOperator
 
Methods inherited from class edu.ucsb.adl.middleware.Query.Constraint
getParent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Query.TemporalConstraint

public Query.TemporalConstraint(java.lang.String bucket,
                                Query.Field field,
                                java.lang.String operator,
                                int begin,
                                int end)
Constructs a TemporalConstraint.

Parameters:
bucket - The bucket to constrain, e.g., "dates".
field - The field to constrain, or null.
operator - The constraint operator, e.g., "overlaps".
begin - The begin date of the target date range using the encoding yyyymmdd, e.g., 19980101.
end - The end date of the target date range using the encoding yyyymmdd, e.g., 19981231.
Throws:
java.lang.IllegalArgumentException - If begin or end are invalid, or if begin is later than end.
java.lang.NullPointerException - If bucket or operator are null.
Method Detail

getBegin

public int getBegin()
Returns the target range begin date.

Returns:
The target range begin date in the encoding yyyymmdd.

getEnd

public int getEnd()
Returns the target range end date.

Returns:
The target range end date in the encoding yyyymmdd.

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.