Class DirectDataChoice

java.lang.Object
ucar.unidata.data.DataChoice
ucar.unidata.data.DirectDataChoice
Direct Known Subclasses:
CompositeDataChoice, KmlInfo

public class DirectDataChoice extends DataChoice
A subclass of DataChoice for supporting a leaf choice. This choice maps directly to data.
Version:
$Revision: 1.56 $
Author:
IDV Development Team
  • Field Details

    • PROP_WRITEDATASOURCE

      public static final String PROP_WRITEDATASOURCE
      This is the XmlEncoder encoding property we use to determine if the datasource should be written out
      See Also:
    • dataSource

      protected DataSource dataSource
      The data source
  • Constructor Details

    • DirectDataChoice

      public DirectDataChoice()
      Default bean constructor; does nothing.
    • DirectDataChoice

      public DirectDataChoice(DataSource dataSource, Object id, String name, String description, List categories, Hashtable properties)
      Create a new DirectDataChoice.
      Parameters:
      dataSource - The source of the data
      id - The identifying object.
      name - The short name of this choice.
      description - The long description of this choice.
      categories - List of DataCategorys.
      properties - The properties for this data choice (may be null).
    • DirectDataChoice

      public DirectDataChoice(DataSource dataSource, Object id, String name, String description, List categories)
      Create a new DirectDataChoice.
      Parameters:
      dataSource - The source of the data
      id - The identifying object.
      name - The short name of this choice.
      description - The long description of this choice.
      categories - List of DataCategorys.
    • DirectDataChoice

      public DirectDataChoice(DataSource dataSource, Object id, String name, String description, List categories, DataSelection dataSelection)
      Create a new DirectDataChoice.
      Parameters:
      dataSource - The source of the data
      id - The identifying object.
      name - The short name of this choice.
      description - The long description of this choice.
      categories - List of DataCategorys.
      dataSelection - The subsetting criteria
    • DirectDataChoice

      public DirectDataChoice(DataSource dataSource, Object id, String name, String description, List categories, DataSelection dataSelection, Hashtable properties)
      Create a new DirectDataChoice.
      Parameters:
      dataSource - The source of the data
      id - The identifying object.
      name - The short name of this choice.
      description - The long description of this choice.
      categories - List of DataCategorys.
      dataSelection - The subsetting criteria
      properties - The properties for this data choice (may be null).
    • DirectDataChoice

      public DirectDataChoice(DirectDataChoice other)
      Copy constructor.
      Parameters:
      other - other DirectDataChoice to get state from
  • Method Details

    • cloneMe

      public DataChoice cloneMe()
      Method for cloning. Calls copy constructor.
      Specified by:
      cloneMe in class DataChoice
      Returns:
      copy of this
    • getFinalDataChoices

      public void getFinalDataChoices(List finalDataChoices)
      Add to the given list all final data choices (i.e., the leafs of the datachoice tree)
      Overrides:
      getFinalDataChoices in class DataChoice
      Parameters:
      finalDataChoices - The list to add to
    • getFullDescription

      public String getFullDescription()
      Get the full description for this DataChoice. Overrides the superclass method.
      Overrides:
      getFullDescription in class DataChoice
      Returns:
      full description
    • getDataSources

      public void getDataSources(List dataSources)
      Add to the given list all the data sources
      Overrides:
      getDataSources in class DataChoice
      Parameters:
      dataSources - List to put data sources into
    • getAllLevels

      public List getAllLevels(DataSelection dataSelection)
      Get all the levels associated with this choice
      Overrides:
      getAllLevels in class DataChoice
      Parameters:
      dataSelection - data selection
      Returns:
      List of levels
    • getAllDateTimes

      public List getAllDateTimes()
      Get all the times associated with this choice.
      Overrides:
      getAllDateTimes in class DataChoice
      Returns:
      all times from the superclass or all times from the datasource
    • getSelectedDateTimes

      public List getSelectedDateTimes()
      Get all the selected times associated with this choice.
      Overrides:
      getSelectedDateTimes in class DataChoice
      Returns:
      the selected times
    • initAfterUnPersistence

      public void initAfterUnPersistence(Hashtable properties)
      This gets called after the data choice has been unpersisted
      Overrides:
      initAfterUnPersistence in class DataChoice
      Parameters:
      properties - Properties
    • getDataSource

      public DataSource getDataSource()
      Get the associated DataSource. Mostly used by XML persistence.
      Returns:
      the DataSource.
    • setDataSource

      public void setDataSource(DataSource s)
      Set the associated DataSource. Mostly used by XML persistence.
      Parameters:
      s - the DataSource.
    • getData

      protected Data getData(DataCategory category, DataSelection dataSelection, Hashtable requestProperties) throws VisADException, RemoteException, DataCancelException
      Get the data that this choice represents.
      Specified by:
      getData in class DataChoice
      Parameters:
      category - The DataCategory used to subset this call (usually not used but placed in here just in case it is needed.)
      dataSelection - Allows one to subset the data request (e.g., asking for a smaller set of times, etc.)
      requestProperties - Extra selection properties
      Returns:
      The data.
      Throws:
      DataCancelException - if the request to get data is canceled
      RemoteException - problem accessing remote data
      VisADException - problem creating the Data object
    • hashCode

      public int hashCode()
      Return the hashcode for this DirectDataChoice
      Overrides:
      hashCode in class DataChoice
      Returns:
      the hashcode
    • equals

      public boolean equals(Object o)
      Check for equality.
      Overrides:
      equals in class DataChoice
      Parameters:
      o - Object to check.
      Returns:
      true if o is equivalent
    • basicallyEquals

      public boolean basicallyEquals(DataChoice that)
      This just checks for basic equality. Things like id, datasource, etc.
      Overrides:
      basicallyEquals in class DataChoice
      Parameters:
      that - The object ot check for equality
      Returns:
      Is basically equals
    • addDataChangeListener

      public void addDataChangeListener(DataChangeListener listener)
      Add the data change listener
      Specified by:
      addDataChangeListener in class DataChoice
      Parameters:
      listener - listener to add
    • removeDataChangeListener

      public void removeDataChangeListener(DataChangeListener listener)
      Remove the data change listener
      Specified by:
      removeDataChangeListener in class DataChoice
      Parameters:
      listener - listener to remove