thredds.catalog.query
Class Selector

java.lang.Object
  extended by thredds.catalog.query.Selector
Direct Known Subclasses:
SelectGeoRegion, SelectList, SelectRange, SelectRangeDate, SelectService, SelectStation

public abstract class Selector
extends java.lang.Object

Abstract class for DQC selector elements.

Author:
john caron

Field Summary
protected  java.util.ArrayList children
           
protected  java.util.List compound
           
protected  InvDocumentation desc
           
protected  java.lang.String id
           
protected  boolean isUsed
           
protected  boolean multiple
           
protected  boolean required
           
protected  java.lang.String template
           
protected  java.lang.String title
           
 
Constructor Summary
protected Selector()
           
protected Selector(java.lang.String title, java.lang.String id, java.lang.String template, java.lang.String required, java.lang.String multiple)
          Construct from fields in XML catalog.
 
Method Summary
 void appendQuery(java.lang.StringBuffer sbuff, java.util.ArrayList values)
          Create the selector result string, and append.
 boolean equals(java.lang.Object o)
          Instances which have same id are equal.
 InvDocumentation getDescription()
           
 java.lang.String getId()
           
 java.lang.String getSelectType()
           
 java.lang.String getTemplate()
           
 java.lang.String getTitle()
           
 int hashCode()
          Override Object.hashCode() to be consistent with this equals.
 boolean isMultiple()
           
 boolean isRequired()
           
 boolean isUsed()
           
 void setCompoundSelectors(java.util.List compound)
           
 void setDescription(InvDocumentation desc)
           
 void setId(java.lang.String id)
           
 void setMultiple(java.lang.String multiple)
           
 void setRequired(java.lang.String required)
           
 void setTemplate(java.lang.String template)
           
 void setTitle(java.lang.String title)
           
 void setUsed(boolean isUsed)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

children

protected java.util.ArrayList children

compound

protected java.util.List compound

isUsed

protected boolean isUsed

title

protected java.lang.String title

id

protected java.lang.String id

template

protected java.lang.String template

required

protected boolean required

multiple

protected boolean multiple

desc

protected InvDocumentation desc
Constructor Detail

Selector

protected Selector()

Selector

protected Selector(java.lang.String title,
                   java.lang.String id,
                   java.lang.String template,
                   java.lang.String required,
                   java.lang.String multiple)
Construct from fields in XML catalog.

Parameters:
title - : human displayable name
id - : unique id
template - : for the query string
required - : true or false
multiple - : true or false
Method Detail

setDescription

public void setDescription(InvDocumentation desc)

getDescription

public InvDocumentation getDescription()

getTitle

public java.lang.String getTitle()

setTitle

public void setTitle(java.lang.String title)

getId

public java.lang.String getId()

setId

public void setId(java.lang.String id)

getTemplate

public java.lang.String getTemplate()

setTemplate

public void setTemplate(java.lang.String template)

isRequired

public boolean isRequired()

setRequired

public void setRequired(java.lang.String required)

isMultiple

public boolean isMultiple()

setMultiple

public void setMultiple(java.lang.String multiple)

getSelectType

public java.lang.String getSelectType()

setCompoundSelectors

public void setCompoundSelectors(java.util.List compound)

isUsed

public boolean isUsed()

setUsed

public void setUsed(boolean isUsed)

appendQuery

public void appendQuery(java.lang.StringBuffer sbuff,
                        java.util.ArrayList values)
Create the selector result string, and append.

Parameters:
sbuff - append here
values - list of selected values, each value is a pair (String, Object), where the String is name of the value, and the Object is the value itself. We use the toString() method on the object to get its String representation.

equals

public boolean equals(java.lang.Object o)
Instances which have same id are equal.

Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Override Object.hashCode() to be consistent with this equals.

Overrides:
hashCode in class java.lang.Object