org.opensha.commons.data.xyz
Interface XYZ_DataSet

All Superinterfaces:
Cloneable, Serializable
All Known Subinterfaces:
GeoDataSet
All Known Implementing Classes:
AbstractGeoDataSet, AbstractXYZ_DataSet, ArbDiscrGeoDataSet, ArbDiscrXYZ_DataSet, EvenlyDiscrXYZ_DataSet, GriddedGeoDataSet

public interface XYZ_DataSet
extends Serializable, Cloneable

Title: XYZ_DataSetAPI

Description: This interface defines the DataSet for the X,Y and Z. This is the parent interface for GeographicDataSetAPI, which should be used for any Geographic (Location based) XYZ datasets.

Copyright: Copyright (c) 2010

Company:

Version:
1.0
Author:
: Kevin Milner

Method Summary
 void abs()
          Takes the absolute value of the each value in the dataset.
 void add(double value)
          The given value is added to each value in this dataset.
 boolean contains(double x, double y)
          Returns true if the dataset contains the given point, false otherwise.
 boolean contains(Point2D point)
          Returns true if the dataset contains the given point, false otherwise.
 XYZ_DataSet copy()
          Returns a shallow copy of this XYZ_DataSet.
 void exp()
          Euler's number e raised to the power of each value in the dataset.
 void exp(double base)
          Given number raised to the power of each value in the dataset.
 double get(double x, double y)
          Gets the value at the given point.
 double get(int index)
          Gets the value at the given index.
 double get(Point2D point)
          Gets the value at the given point.
 double getMaxX()
          Returns the maximum X value in this dataset.
 double getMaxY()
          Returns the maximum Y value in this dataset.
 double getMaxZ()
          Returns the maximum Z value in this dataset.
 double getMinX()
          Returns the minimum X value in this dataset.
 double getMinY()
          Returns the minimum Y value in this dataset.
 double getMinZ()
          Returns the minimum Z value in this dataset.
 Point2D getPoint(int index)
          Gets the point at the given index.
 List<Point2D> getPointList()
          Returns a list of all points in the correct order (as defined by indexOf).
 double getSumZ()
           
 List<Double> getValueList()
          Returns a list of all values in the correct order (as defined by indexOf).
 int indexOf(double x, double y)
          Returns the index of the given point, or -1 if it isn't in the dataset.
 int indexOf(Point2D point)
          Returns the index of the given point, or -1 if it isn't in the dataset.
 void log()
          Takes the natural log of each value in the dataset.
 void log10()
          Takes the natural log base 10 of each value in the dataset.
 void pow(double pow)
          Each value in this dataset is raised to the given power.
 void scale(double scalar)
          Each value in this dataset is scaled by the given scalar.
 void set(double x, double y, double z)
          Sets the value at the given point.
 void set(int index, double z)
          Sets the value at the given index.
 void set(Point2D point, double z)
          Sets the value at the given point.
 void setAll(XYZ_DataSet dataset)
          Sets every point in this dataset from the given dataset.
 int size()
          Returns the size of this dataset.
 

Method Detail

getMinX

double getMinX()
Returns the minimum X value in this dataset.

Returns:
minimum X value, or positive infinity if the dataset is empty

getMaxX

double getMaxX()
Returns the maximum X value in this dataset.

Returns:
maximum X value, or negative infinity if the dataset is empty

getMinY

double getMinY()
Returns the minimum Y value in this dataset.

Returns:
minimum Y value, or positive infinity if the dataset is empty

getMaxY

double getMaxY()
Returns the maximum Y value in this dataset.

Returns:
maximum Y value, or negative infinity if the dataset is empty

getMinZ

double getMinZ()
Returns the minimum Z value in this dataset.

Returns:
minimum Z value, or positive infinity if the dataset is empty

getMaxZ

double getMaxZ()
Returns the maximum Z value in this dataset.

Returns:
maximum Z value, or negative infinity if the dataset is empty

getSumZ

double getSumZ()
Returns:
the sum of all Z values

set

void set(Point2D point,
         double z)
Sets the value at the given point. If the point doesn't exist, it will be added to the dataset.

Parameters:
point - - the point at which to set
z - - the value to set
Throws:
NullPointerException - if point is null

set

void set(double x,
         double y,
         double z)
Sets the value at the given point. If the point doesn't exist, it will be added to the dataset.

Parameters:
x - - the x value of the point at which to set
y - - the y value of the point at which to set
z - - the value to set

set

void set(int index,
         double z)
Sets the value at the given index. If index < 0 or index >= size(), then an exception is thrown.

Parameters:
index - - the index of the point to be set
z - - the value to set
Throws:
IndexOutOfBoundsException - if index < 0 or index >= size()

get

double get(Point2D point)
Gets the value at the given point. If the point doesn't exist, null will be returned.

Parameters:
point - - the point at which to get
Returns:
the value at the given point, or null if the point is not contained in the dataset

get

double get(double x,
           double y)
Gets the value at the given point. If the point doesn't exist, null will be returned.

Parameters:
x - - the x value of the point at which to get
y - - the y value of the point at which to get
Returns:
the value at the given point

get

double get(int index)
Gets the value at the given index. If index < 0 or index >= size(), then an exception is thrown.

Parameters:
index - - the index of the point at which to get
Returns:
the value at the given index

getPoint

Point2D getPoint(int index)
Gets the point at the given index. If index < 0 or index >= size(), then an exception is thrown.

Parameters:
index - - the index of the point to get
Returns:
the point at the given index
Throws:
IndexOutOfBoundsException - if index < 0 or index >= size()

indexOf

int indexOf(Point2D point)
Returns the index of the given point, or -1 if it isn't in the dataset.

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

indexOf

int indexOf(double x,
            double y)
Returns the index of the given point, or -1 if it isn't in the dataset.

Parameters:
x - - the x value of the point at which to return the index
y - - the y value of the point at which to return the index
Returns:
index of the given point, or -1 if it isn't in the dataset.

contains

boolean contains(Point2D point)
Returns true if the dataset contains the given point, false otherwise.

Parameters:
point - - the point to check
Returns:
true if point is not null and is contained by the dataset, false otherwise

contains

boolean contains(double x,
                 double y)
Returns true if the dataset contains the given point, false otherwise.

Parameters:
x - - the x value of the point to check
y - - the y value of the point to check
Returns:
true if the dataset contains the given point, false otherwise

size

int size()
Returns the size of this dataset.

Returns:
size of this dataset

setAll

void setAll(XYZ_DataSet dataset)
Sets every point in this dataset from the given dataset.

Parameters:
dataset - - dataset who's values are to be set
Throws:
NullPointerException - if dataset is null

getPointList

List<Point2D> getPointList()
Returns a list of all points in the correct order (as defined by indexOf). If the dataset is empty, then an empty list will be returned.

Returns:
list of all points in the dataset

getValueList

List<Double> getValueList()
Returns a list of all values in the correct order (as defined by indexOf). If the dataset is empty, then an empty list will be returned.

Returns:
list of all values in the dataset

copy

XYZ_DataSet copy()
Returns a shallow copy of this XYZ_DataSet. Internal points are not cloned.

Returns:
shallow copy of this XYZ_DataSet

abs

void abs()
Takes the absolute value of the each value in the dataset.

Parameters:
map -

log

void log()
Takes the natural log of each value in the dataset.


log10

void log10()
Takes the natural log base 10 of each value in the dataset.


exp

void exp()
Euler's number e raised to the power of each value in the dataset.


exp

void exp(double base)
Given number raised to the power of each value in the dataset.


pow

void pow(double pow)
Each value in this dataset is raised to the given power.

Parameters:
pow - - the power with which to raise each value in the dataset

scale

void scale(double scalar)
Each value in this dataset is scaled by the given scalar.

Parameters:
scalar - - the double value with which to scale each value in the dataset

add

void add(double value)
The given value is added to each value in this dataset.

Parameters:
value - - the double value to add to each value in the dataset