edu.ucsb.adl.middleware
Class Query.HierarchicalConstraint
java.lang.Object
|
+--edu.ucsb.adl.middleware.Query.Constraint
|
+--edu.ucsb.adl.middleware.Query.SimpleConstraint
|
+--edu.ucsb.adl.middleware.Query.HierarchicalConstraint
- Enclosing class:
- Query
- public static final class Query.HierarchicalConstraint
- extends Query.SimpleConstraint
A hierarchical categorization constraint.
|
Constructor Summary |
Query.HierarchicalConstraint(java.lang.String bucket,
Query.Field field,
java.lang.String operator,
java.lang.String term,
java.lang.String vocabulary)
Constructs a HierarchicalConstraint. |
|
Method Summary |
java.lang.String |
getTerm()
Returns the target term. |
java.lang.String |
getVocabulary()
Returns the target term's vocabulary. |
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.HierarchicalConstraint
public Query.HierarchicalConstraint(java.lang.String bucket,
Query.Field field,
java.lang.String operator,
java.lang.String term,
java.lang.String vocabulary)
- Constructs a
HierarchicalConstraint.
- Parameters:
bucket - The bucket to constrain, e.g., "types".field - The field to constrain, or null.operator - The constraint operator, e.g., "is-a".term - The target term, e.g., "aerial photographs".vocabulary - The source of the term, e.g., "ADL Object Type
Thesaurus".
- Throws:
java.lang.NullPointerException - If any of the arguments other than field is
null.
getTerm
public java.lang.String getTerm()
- Returns the target term.
- Returns:
- The target term.
getVocabulary
public java.lang.String getVocabulary()
- Returns the target term's vocabulary.
- Returns:
- The vocabulary.
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.