org.opensha.commons.data.xyz
Class GriddedGeoDataSet

java.lang.Object
  extended by org.opensha.commons.data.xyz.AbstractXYZ_DataSet
      extended by org.opensha.commons.data.xyz.AbstractGeoDataSet
          extended by org.opensha.commons.data.xyz.GriddedGeoDataSet
All Implemented Interfaces:
Serializable, Cloneable, GeoDataSet, XYZ_DataSet

public class GriddedGeoDataSet
extends AbstractGeoDataSet

This is a Geohgraphic Dataset on a regular grid, as defined by a GriddedRegion. Points not in the given GriddedRegion cannot be set.

Author:
kevin
See Also:
Serialized Form

Constructor Summary
GriddedGeoDataSet(GriddedRegion region, boolean latitudeX)
           
 
Method Summary
 Object clone()
           
 boolean contains(Location loc)
          Returns true if the dataset contains the given Location, false otherwise.
 GriddedGeoDataSet copy()
          Returns a shallow copy of this GeoDataSet.
 double get(Location loc)
          Get the value at the given Location, or null if it doesn't exist.
 Location getLocation(int index)
          Returns the location at the given index.
 LocationList getLocationList()
          Returns a list of all locations in the correct order (as defined by indexOf).
 GriddedRegion getRegion()
           
 int indexOf(Location loc)
          Returns the index of the given location, or -1 if it doesn't exist.
 void set(Location loc, double value)
          Set the value at the given Location.
 int size()
          Returns the size of this dataset.
 
Methods inherited from class org.opensha.commons.data.xyz.AbstractGeoDataSet
contains, contains, get, get, get, getMaxLat, getMaxLon, getMaxX, getMaxY, getMaxZ, getMinLat, getMinLon, getMinX, getMinY, getMinZ, getPoint, getPointList, getValueList, getZTracker, indexOf, indexOf, isLatitudeX, locToPoint, ptToLoc, set, set, set, setAll, setLatitudeX
 
Methods inherited from class org.opensha.commons.data.xyz.AbstractXYZ_DataSet
abs, add, exp, exp, getSumZ, log, log10, pow, scale, writeXYZFile, writeXYZFile
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.opensha.commons.data.xyz.XYZ_DataSet
abs, add, exp, exp, getSumZ, log, log10, pow, scale
 

Constructor Detail

GriddedGeoDataSet

public GriddedGeoDataSet(GriddedRegion region,
                         boolean latitudeX)
Method Detail

size

public int size()
Description copied from interface: XYZ_DataSet
Returns the size of this dataset.

Returns:
size of this dataset

set

public void set(Location loc,
                double value)
Description copied from interface: GeoDataSet
Set the value at the given Location. If the location doesn't exist in the dataset then it will be added.

Parameters:
loc - - the location at which to set
value - - the value to set

get

public double get(Location loc)
Description copied from interface: GeoDataSet
Get the value at the given Location, or null if it doesn't exist.

Parameters:
loc - - the location at which to get
Returns:
the value at the given location

indexOf

public int indexOf(Location loc)
Description copied from interface: GeoDataSet
Returns the index of the given location, or -1 if it doesn't exist.

Parameters:
loc - - the location at which to return the index
Returns:
the index of the given location, or -1 if it isn't in the dataset.

getLocation

public Location getLocation(int index)
Description copied from interface: GeoDataSet
Returns the location at the given index. If index < 0 or index >= size(), an exception will be thrown.

Parameters:
index - - the index at which to get the location
Returns:
the location at the given index

contains

public boolean contains(Location loc)
Description copied from interface: GeoDataSet
Returns true if the dataset contains the given Location, false otherwise.

Parameters:
loc - - the location to test
Returns:
true if the dataset contains the given location, false otherwise

clone

public Object clone()
Overrides:
clone in class Object

copy

public GriddedGeoDataSet copy()
Description copied from interface: GeoDataSet
Returns a shallow copy of this GeoDataSet. Internal points are not cloned.

Returns:
shallow copy of this GeoDataSet

getLocationList

public LocationList getLocationList()
Description copied from interface: GeoDataSet
Returns a list of all locations in the correct order (as defined by indexOf).

Returns:
list of all locations in the dataset

getRegion

public GriddedRegion getRegion()