gov.noaa.pmel.sgt.dm
Class SimpleGrid

java.lang.Object
  extended by gov.noaa.pmel.sgt.dm.SimpleGrid
All Implemented Interfaces:
Cartesian, CoordinateSystem, SGTData, SGTGrid, java.io.Serializable, java.lang.Cloneable

public class SimpleGrid
extends java.lang.Object
implements SGTGrid, Cartesian, java.lang.Cloneable, java.io.Serializable

SimpleGrid provides an implementation of the SGTGrid and Cartesian interfaces.

Since:
1.0
Version:
$Revision$, $Date$
Author:
Donald Denbo
See Also:
SGTGrid, Cartesian, Serialized Form

Field Summary
protected  SGTGrid associatedData_
           
protected  double[] grid_
           
protected  boolean hasXEdges_
           
protected  boolean hasYEdges_
           
protected  java.lang.String id_
           
protected  SGLabel keyTitle_
           
protected  GeoDateArray tEdges_
           
protected  java.lang.String title_
           
protected  GeoDateArray tloc_
           
protected  double[] xEdges_
           
protected  double[] xloc_
           
protected  SGTMetaData xMetaData_
           
protected  boolean xTime_
           
protected  double[] yEdges_
           
protected  double[] yloc_
           
protected  SGTMetaData yMetaData_
           
protected  boolean yTime_
           
protected  SGTMetaData zMetaData_
           
 
Constructor Summary
SimpleGrid()
          Default constructor.
SimpleGrid(double[] grid, double[] xloc, double[] yloc, java.lang.String title)
          Constructor for X and Y coordinates as double.
SimpleGrid(double[] grid, double[] xloc, GeoDate[] tloc, java.lang.String title)
          Constructor for X double and Y time.
SimpleGrid(double[] grid, GeoDate[] tloc, double[] yloc, java.lang.String title)
          Constructor for X time and Y double.
 
Method Summary
 void addPropertyChangeListener(java.beans.PropertyChangeListener l)
          Add a PropertyChangeListener to the listener list.
 SGTData copy()
          Create a copy of the grid.
 SGTGrid getAssociatedData()
          Get the associated data.
 GeoDateArray getGeoDateArray()
          Get the GeoDateArray object.
 GeoDateArray getGeoDateArrayEdges()
          Get the GeoDateArray object.
 java.lang.String getId()
          Get the unique identifier.
 SGLabel getKeyTitle()
          Get a title formatted for a Key.
 GeoDate[] getTimeArray()
          Get the array of temporal values.
 GeoDate[] getTimeEdges()
          Get the Time edges.
 java.lang.String getTitle()
          Get the title.
 int getTSize()
          Get the length of the Time axis
 double[] getXArray()
          Get the array of X values.
 double[] getXEdges()
          Get the X coordinate edges.
 SoTRange getXEdgesRange()
          Return the range of the x edges
 SGTMetaData getXMetaData()
          Returns the X SGTMetaData.
 SoTRange getXRange()
          Returns the range of the X coordinates.
 int getXSize()
          Get the length of the x axis
 double[] getYArray()
          Get the array of Y values.
 double[] getYEdges()
          Get the Y coordinate edges.
 SoTRange getYEdgesRange()
          Return the range of the y edges
 SGTMetaData getYMetaData()
          Returns the Y SGTMetaData.
 SoTRange getYRange()
          Returns the range of the Y coordinates.
 int getYSize()
          Get the length of the y axis
 double[] getZArray()
          Get the array of Z values.
 SGTMetaData getZMetaData()
          Get the Z SGTMetaData.
 Range2D getZRange()
          Get the range of Z values.
 boolean hasAssociatedData()
          Is there associated data available?
 boolean hasXEdges()
          Are X edges available?
 boolean hasYEdges()
          Are Y edges available?
 boolean isXTime()
          Returns true if the X coordinate is Time.
 boolean isYTime()
          Returns true if the Y coordinate is Time.
 void removePropertyChangeListener(java.beans.PropertyChangeListener l)
          Remove a PropertyChangeListener from the listener list.
 void setAssociatedData(SGTGrid assoc)
          Set the associated data grid.
 void setId(java.lang.String ident)
          Set the unique identifier.
 void setKeyTitle(SGLabel title)
          Set the title formatted for the VectorKey.
 void setTimeArray(GeoDate[] tloc)
          set the temporal grid centers
Property Change: dataModified.
 void setTimeArray(GeoDateArray tarray)
           
 void setTimeEdges(GeoDate[] edge)
          Set the values for the temporal grid edges.
 void setTimeEdges(GeoDateArray tarray)
           
 void setTitle(java.lang.String title)
          Set the grid title
 void setXArray(double[] xloc)
          Set the x coordinate grid centers
Property Change: dataModified.
 void setXEdges(double[] edge)
          Set the values for the x grid edges.
 void setXMetaData(SGTMetaData md)
          Set the SGTMetaData associated with the x coordinate.
 void setYArray(double[] yloc)
          Set the y coordinate grid centers
Property Change: dataModified.
 void setYEdges(double[] edge)
          Set the values for the y grid edges.
 void setYMetaData(SGTMetaData md)
          Set the SGTMetaData associated with the y coordinate.
 void setZArray(double[] grid)
          Set the z grid values.
 void setZMetaData(SGTMetaData md)
          Set the SGTMetaData associated with the z coordinate.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

xloc_

protected double[] xloc_

yloc_

protected double[] yloc_

tloc_

protected GeoDateArray tloc_

grid_

protected double[] grid_

xEdges_

protected double[] xEdges_

yEdges_

protected double[] yEdges_

tEdges_

protected GeoDateArray tEdges_

hasXEdges_

protected boolean hasXEdges_

hasYEdges_

protected boolean hasYEdges_

title_

protected java.lang.String title_

keyTitle_

protected SGLabel keyTitle_

id_

protected java.lang.String id_

xTime_

protected boolean xTime_

yTime_

protected boolean yTime_

xMetaData_

protected SGTMetaData xMetaData_

yMetaData_

protected SGTMetaData yMetaData_

zMetaData_

protected SGTMetaData zMetaData_

associatedData_

protected SGTGrid associatedData_
Constructor Detail

SimpleGrid

public SimpleGrid()
Default constructor.


SimpleGrid

public SimpleGrid(double[] grid,
                  double[] xloc,
                  double[] yloc,
                  java.lang.String title)
Constructor for X and Y coordinates as double.

Parameters:
grid - Z values
xloc - X coordinates
yloc - Y coordinates
title - the title

SimpleGrid

public SimpleGrid(double[] grid,
                  GeoDate[] tloc,
                  double[] yloc,
                  java.lang.String title)
Constructor for X time and Y double.

Parameters:
grid - Z values
tloc - Time coordinates
yloc - Y coordinates
title - the title

SimpleGrid

public SimpleGrid(double[] grid,
                  double[] xloc,
                  GeoDate[] tloc,
                  java.lang.String title)
Constructor for X double and Y time.

Parameters:
grid - Z values
xloc - X coordinates
tloc - Time coordinates
title - the title
Method Detail

copy

public SGTData copy()
Create a copy of the grid.

Specified by:
copy in interface SGTData
Returns:
shallow copy
Since:
2.0
See Also:
SGTData

getXArray

public double[] getXArray()
Description copied from interface: SGTGrid
Get the array of X values.

Specified by:
getXArray in interface SGTGrid

getXSize

public int getXSize()
Get the length of the x axis

Specified by:
getXSize in interface SGTGrid
Since:
2.0

getYArray

public double[] getYArray()
Description copied from interface: SGTGrid
Get the array of Y values.

Specified by:
getYArray in interface SGTGrid

getYSize

public int getYSize()
Get the length of the y axis

Specified by:
getYSize in interface SGTGrid
Since:
2.0

getZArray

public double[] getZArray()
Description copied from interface: SGTGrid
Get the array of Z values.

Specified by:
getZArray in interface SGTGrid

getTimeArray

public GeoDate[] getTimeArray()
Description copied from interface: SGTGrid
Get the array of temporal values.

Specified by:
getTimeArray in interface SGTGrid

getGeoDateArray

public GeoDateArray getGeoDateArray()
Get the GeoDateArray object.

Specified by:
getGeoDateArray in interface SGTGrid
Since:
3.0

getTSize

public int getTSize()
Get the length of the Time axis

Specified by:
getTSize in interface SGTGrid
Since:
2.0

isXTime

public boolean isXTime()
Description copied from interface: SGTData
Returns true if the X coordinate is Time.

Specified by:
isXTime in interface SGTData

isYTime

public boolean isYTime()
Description copied from interface: SGTData
Returns true if the Y coordinate is Time.

Specified by:
isYTime in interface SGTData

getXMetaData

public SGTMetaData getXMetaData()
Description copied from interface: SGTData
Returns the X SGTMetaData.

Specified by:
getXMetaData in interface SGTData

getYMetaData

public SGTMetaData getYMetaData()
Description copied from interface: SGTData
Returns the Y SGTMetaData.

Specified by:
getYMetaData in interface SGTData

getZMetaData

public SGTMetaData getZMetaData()
Description copied from interface: SGTGrid
Get the Z SGTMetaData.

Specified by:
getZMetaData in interface SGTGrid

getTitle

public java.lang.String getTitle()
Description copied from interface: SGTData
Get the title.

Specified by:
getTitle in interface SGTData

setAssociatedData

public void setAssociatedData(SGTGrid assoc)
Set the associated data grid.
Property Change: associatedDataModified.

Since:
2.0

getAssociatedData

public SGTGrid getAssociatedData()
Description copied from interface: SGTGrid
Get the associated data. The associated data must be of the same type (SGTGrid) and shape.

Specified by:
getAssociatedData in interface SGTGrid

hasAssociatedData

public boolean hasAssociatedData()
Description copied from interface: SGTGrid
Is there associated data available?

Specified by:
hasAssociatedData in interface SGTGrid

hasXEdges

public boolean hasXEdges()
Description copied from interface: SGTGrid
Are X edges available?

Specified by:
hasXEdges in interface SGTGrid

getXEdges

public double[] getXEdges()
Description copied from interface: SGTGrid
Get the X coordinate edges. The XEdge length will be one greater than the XArray length.

Specified by:
getXEdges in interface SGTGrid

setXEdges

public void setXEdges(double[] edge)
Set the values for the x grid edges.


hasYEdges

public boolean hasYEdges()
Description copied from interface: SGTGrid
Are Y edges available?

Specified by:
hasYEdges in interface SGTGrid

getYEdges

public double[] getYEdges()
Description copied from interface: SGTGrid
Get the Y coordinate edges. The YEdge length will be one greater than the YArray length.

Specified by:
getYEdges in interface SGTGrid

setYEdges

public void setYEdges(double[] edge)
Set the values for the y grid edges.


getTimeEdges

public GeoDate[] getTimeEdges()
Description copied from interface: SGTGrid
Get the Time edges. The TimeEdge length will be one greater than the TimeArray length.

Specified by:
getTimeEdges in interface SGTGrid

getGeoDateArrayEdges

public GeoDateArray getGeoDateArrayEdges()
Get the GeoDateArray object.

Specified by:
getGeoDateArrayEdges in interface SGTGrid
Since:
3.0

setTimeEdges

public void setTimeEdges(GeoDate[] edge)
Set the values for the temporal grid edges.


setTimeEdges

public void setTimeEdges(GeoDateArray tarray)
Since:
3.0

setXMetaData

public void setXMetaData(SGTMetaData md)
Set the SGTMetaData associated with the x coordinate.


setYMetaData

public void setYMetaData(SGTMetaData md)
Set the SGTMetaData associated with the y coordinate.


setZMetaData

public void setZMetaData(SGTMetaData md)
Set the SGTMetaData associated with the z coordinate.


setTitle

public void setTitle(java.lang.String title)
Set the grid title


getKeyTitle

public SGLabel getKeyTitle()
Description copied from interface: SGTData
Get a title formatted for a Key. JPlotLayout will use this if an explicit Key title is not given in the addData method.

Specified by:
getKeyTitle in interface SGTData
See Also:
SGLabel, ColorKey, LineKey, PointCollectionKey, VectorKey

setKeyTitle

public void setKeyTitle(SGLabel title)
Set the title formatted for the VectorKey.


getId

public java.lang.String getId()
Get the unique identifier. The presence of the identifier is optional, but if it is present it should be unique. This field is used to search for the layer that contains the data.

Specified by:
getId in interface SGTData
Returns:
unique identifier
Since:
2.0
See Also:
Pane, Layer

setId

public void setId(java.lang.String ident)
Set the unique identifier.


setXArray

public void setXArray(double[] xloc)
Set the x coordinate grid centers
Property Change: dataModified.


setYArray

public void setYArray(double[] yloc)
Set the y coordinate grid centers
Property Change: dataModified.


setZArray

public void setZArray(double[] grid)
Set the z grid values.
Property Change: dataModified.


setTimeArray

public void setTimeArray(GeoDate[] tloc)
set the temporal grid centers
Property Change: dataModified.


setTimeArray

public void setTimeArray(GeoDateArray tarray)
Since:
3.0

getXRange

public SoTRange getXRange()
Description copied from interface: SGTData
Returns the range of the X coordinates. If all the data in the array is missing, this method will return Double.NaN as the start and end values for data of type double and return GeoDate(Long.MIN_VALUE) for data of type GeoDate.

Specified by:
getXRange in interface SGTData
See Also:
GeoDate.isMissing()

getYRange

public SoTRange getYRange()
Description copied from interface: SGTData
Returns the range of the Y coordinates.

Specified by:
getYRange in interface SGTData
See Also:
SGTData.getXRange()

getZRange

public Range2D getZRange()
Description copied from interface: SGTGrid
Get the range of Z values.

Specified by:
getZRange in interface SGTGrid

getXEdgesRange

public SoTRange getXEdgesRange()
Return the range of the x edges

Specified by:
getXEdgesRange in interface SGTGrid
Since:
2.0

getYEdgesRange

public SoTRange getYEdgesRange()
Return the range of the y edges

Specified by:
getYEdgesRange in interface SGTGrid
Since:
2.0

addPropertyChangeListener

public void addPropertyChangeListener(java.beans.PropertyChangeListener l)
Description copied from interface: SGTData
Add a PropertyChangeListener to the listener list.

Specified by:
addPropertyChangeListener in interface SGTData

removePropertyChangeListener

public void removePropertyChangeListener(java.beans.PropertyChangeListener l)
Description copied from interface: SGTData
Remove a PropertyChangeListener from the listener list.

Specified by:
removePropertyChangeListener in interface SGTData