ucar.unidata.data
Class DataSelection

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

public class DataSelection
extends Object

A class that represents some selection of data.

Version:
$Revision: 1.43 $
Author:
IDV Development Team

Field Summary
static DataSelection NULL
          Null DataSelection
static String PROP_CHOOSERTIMEMATCHING
           
static String PROP_DATESELECTION
          Flag to use any times set elsewhere
static String PROP_DEFAULT_LEVELS
          Property for selected levels
static String PROP_USESTIMEDRIVER
          status template
static int TIMESMODE_USEOTHER
          Flag to use any times set elsewhere
static int TIMESMODE_USETHIS
          Flag to use any times set here
 
Constructor Summary
DataSelection()
          Construct a DataSelection.
DataSelection(boolean setDefaults)
          Construct a DataSelection.
DataSelection(DataSelection that)
          Construct a DataSelection from another instance.
DataSelection(int zStride)
          ctor
DataSelection(int xStride, int yStride, int zStride)
          ctor
DataSelection(List times)
          Construct a DataSelection with a list of times.
DataSelection(List times, int timesMode)
          Construct a DataSelection with a list of times and a particular times mode.
DataSelection(Object fromLevel, Object toLevel)
          ctor
 
Method Summary
 DataSelection cloneMe()
          Method for creating a clone of this DataSelection
 boolean equals(Object o)
          See if the Object in question is equal to this DataSelection.
 Object getFromLevel()
          Get the FromLevel property.
 GeoSelection getGeoSelection()
          Get the GeoSelection property.
 GeoSelection getGeoSelection(boolean createIfNeeded)
          Get the GeoSelection property.
 Hashtable getProperties()
          Get the Properties property.
 Object getProperty(Object key)
          get the property
 List<DateTime> getTimeDriverTimes()
          Get the TimeDriverTimes property.
 List getTimes()
          Get the list of times held by this DataSelection
 int getTimesMode()
          Get the times mode.
 Object getToLevel()
          Get the ToLevel property.
 boolean getUseThisTimes()
          Determine whether we should use the times from this DataSelection or not.
 int hashCode()
          Get the hash code for this DataSelection
 boolean hasTimes()
          Check whether this DataSelection has a time selection or not.
static DataSelection merge(DataSelection higherPriority, DataSelection lowerPriority)
          If either of the params are null then simply return the other one.
 void putProperty(Object key, Object value)
          put the property
 void removeProperty(Object key)
          remove the property identified by the given key
 void setBounds(double north, double west, double south, double east)
          set the clipping bounds
 void setFromLevel(Object value)
          Set the FromLevel property.
 void setGeoSelection(GeoSelection value)
          Set the GeoSelection property.
 void setLevel(Object level)
          Set the level.
 void setLevelRange(Object fromLevel, Object toLevel)
          Set the Level property.
 void setProperties(Hashtable value)
          Set the Properties property.
 void setTheTimeDriverTimes(List<DateTime> value)
          Set the TimeDriverTimes property.
 void setTimes(List selectedTimes)
          Set the times list held by this DataSelection.
 void setTimesMode(int mode)
          Set the times mode.
 void setToLevel(Object value)
          Set the ToLevel property.
 void setXStride(int stride)
          set the x stride
 void setXYStride(int stride)
          set the x and y stride
 void setYStride(int stride)
          set the y stride
 void setZStride(int stride)
          set the z stride
 String toString()
          Return a string representation of this DataSelection.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

NULL

public static final DataSelection NULL
Null DataSelection


PROP_DEFAULT_LEVELS

public static final String PROP_DEFAULT_LEVELS
Property for selected levels

See Also:
Constant Field Values

PROP_DATESELECTION

public static final String PROP_DATESELECTION
Flag to use any times set elsewhere

See Also:
Constant Field Values

PROP_USESTIMEDRIVER

public static final String PROP_USESTIMEDRIVER
status template

See Also:
Constant Field Values

PROP_CHOOSERTIMEMATCHING

public static final String PROP_CHOOSERTIMEMATCHING
See Also:
Constant Field Values

TIMESMODE_USETHIS

public static final int TIMESMODE_USETHIS
Flag to use any times set here

See Also:
Constant Field Values

TIMESMODE_USEOTHER

public static final int TIMESMODE_USEOTHER
Flag to use any times set elsewhere

See Also:
Constant Field Values
Constructor Detail

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 Detail

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

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