Class DataSelection

java.lang.Object
ucar.unidata.data.DataSelection

public class DataSelection extends Object
A class that represents some selection of data.
Author:
IDV Development Team
  • Field Details

  • Constructor Details

    • DataSelection

      public DataSelection()
      Construct a DataSelection.
    • DataSelection

      public DataSelection(Object fromLevel, Object toLevel)
      ctor
      Parameters:
      fromLevel - from level
      toLevel - -0
    • DataSelection

      public DataSelection(int zStride)
      ctor
      Parameters:
      zStride - z stride
    • DataSelection

      public DataSelection(int xStride, int yStride, int zStride)
      ctor
      Parameters:
      xStride - stride
      yStride - stride
      zStride - stride
    • DataSelection

      public DataSelection(boolean setDefaults)
      Construct a DataSelection.
      Parameters:
      setDefaults - If true then we set our defaults from the global defaults
    • DataSelection

      public DataSelection(List times)
      Construct a DataSelection with a list of times. Use the default times mode
      Parameters:
      times - List of DateTimes
    • DataSelection

      public DataSelection(List times, int timesMode)
      Construct a DataSelection with a list of times and a particular times mode.
      Parameters:
      times - List of DateTimes
      timesMode - mode to use (TIMESMODE_USETHIS, TIMESMODE_USEOTHER)
    • DataSelection

      public DataSelection(DataSelection that)
      Construct a DataSelection from another instance.
      Parameters:
      that - other DataSelection
  • Method Details

    • setXYStride

      public void setXYStride(int stride)
      set the x and y stride
      Parameters:
      stride - the stride
    • setXStride

      public void setXStride(int stride)
      set the x stride
      Parameters:
      stride - the stride
    • setYStride

      public void setYStride(int stride)
      set the y stride
      Parameters:
      stride - the stride
    • setZStride

      public void setZStride(int stride)
      set the z stride
      Parameters:
      stride - the stride
    • setBounds

      public void setBounds(double north, double west, double south, double east)
      set the clipping bounds
      Parameters:
      north - north
      west - west
      south - south
      east - east
    • merge

      public static DataSelection merge(DataSelection higherPriority, DataSelection lowerPriority)
      If either of the params are null then simply return the other one. Else, create a new DataSelection and set its times and other attributes to those held by the higherPriority param if it contains times, etc., else set it to the lowerPriority param.
      Parameters:
      higherPriority - DataSelection with higher priority
      lowerPriority - DataSelection with lower priority
      Returns:
      the new DataSelection
    • getUseThisTimes

      public boolean getUseThisTimes()
      Determine whether we should use the times from this DataSelection or not.
      Returns:
      true if we should use the times from this
    • setTimesMode

      public void setTimesMode(int mode)
      Set the times mode.
      Parameters:
      mode - (TIMESMODE_USEOTHER, TIMESMODE_USETHIS)
    • getTimesMode

      public int getTimesMode()
      Get the times mode.
      Returns:
      TIMESMODE_USEOTHER or TIMESMODE_USETHIS
    • cloneMe

      public DataSelection cloneMe()
      Method for creating a clone of this DataSelection
      Returns:
      cloned version
    • hasTimes

      public boolean hasTimes()
      Check whether this DataSelection has a time selection or not.
      Returns:
      true if it has times set
    • setTimes

      public void setTimes(List selectedTimes)
      Set the times list held by this DataSelection. The given argument may be null and is cloned. This list represents the set of selected times which may either be DateTime objects or Integer indices.
      Parameters:
      selectedTimes - The new times list.
    • getTimes

      public List getTimes()
      Get the list of times held by this DataSelection
      Returns:
      list of times
    • hashCode

      public int hashCode()
      Get the hash code for this DataSelection
      Overrides:
      hashCode in class Object
      Returns:
      the hash code
    • equals

      public boolean equals(Object o)
      See if the Object in question is equal to this DataSelection.
      Overrides:
      equals in class Object
      Parameters:
      o - Object in question
      Returns:
      true if they are equal
    • toString

      public String toString()
      Return a string representation of this DataSelection.
      Overrides:
      toString in class Object
      Returns:
      a string representation of this DataSelection
    • setLevel

      public void setLevel(Object level)
      Set the level. This in effect sets both the from and the to level to the argument
      Parameters:
      level - The level
    • setLevelRange

      public void setLevelRange(Object fromLevel, Object toLevel)
      Set the Level property.
      Parameters:
      fromLevel - from level
      toLevel - to level
    • setFromLevel

      public void setFromLevel(Object value)
      Set the FromLevel property.
      Parameters:
      value - The new value for FromLevel
    • getFromLevel

      public Object getFromLevel()
      Get the FromLevel property.
      Returns:
      The FromLevel
    • setToLevel

      public void setToLevel(Object value)
      Set the ToLevel property.
      Parameters:
      value - The new value for ToLevel
    • getToLevel

      public Object getToLevel()
      Get the ToLevel property.
      Returns:
      The ToLevel
    • setGeoSelection

      public void setGeoSelection(GeoSelection value)
      Set the GeoSelection property.
      Parameters:
      value - The new value for GeoSelection
    • getGeoSelection

      public GeoSelection getGeoSelection()
      Get the GeoSelection property.
      Returns:
      The GeoSelection
    • getGeoSelection

      public GeoSelection getGeoSelection(boolean createIfNeeded)
      Get the GeoSelection property.
      Parameters:
      createIfNeeded - If true then create the geosubset of we don't have one already.
      Returns:
      The GeoSelection
    • setProperties

      public void setProperties(Hashtable value)
      Set the Properties property.
      Parameters:
      value - The new value for Properties
    • getProperties

      public Hashtable getProperties()
      Get the Properties property.
      Returns:
      The Properties
    • getProperty

      public Object getProperty(Object key)
      get the property
      Parameters:
      key - property key
      Returns:
      property value
    • removeProperty

      public void removeProperty(Object key)
      remove the property identified by the given key
      Parameters:
      key - property key
    • getProperty

      public boolean getProperty(String name, boolean dflt)
      Get the named boolean property
      Parameters:
      name - name of property
      dflt - default value
      Returns:
      the value of the property or the default
    • getProperty

      public String getProperty(String name, String dflt)
      Get the named object property
      Parameters:
      name - name of property
      dflt - default value
      Returns:
      the value of the property or the default
    • putProperty

      public void putProperty(Object key, Object value)
      put the property
      Parameters:
      key - key
      value - value
    • setTheTimeDriverTimes

      public void setTheTimeDriverTimes(List<DateTime> value)
      Set the TimeDriverTimes property.
      Parameters:
      value - The new value for TimeDriverTimes
    • getTimeDriverTimes

      public List<DateTime> getTimeDriverTimes()
      Get the TimeDriverTimes property.
      Returns:
      The TimeDriverTimes