jhplot
Class P2D

java.lang.Object
  extended by jhplot.P2D

public class P2D
extends java.lang.Object

A container to hold data points in X,Y,Z.


Constructor Summary
P2D()
          Construct an empty container with a title
P2D(java.lang.String title)
          Construct an empty container with a title
P2D(java.lang.String title, java.lang.String sfile)
          Construct a P2D from a file.
 
Method Summary
 void add(double x, double y, double z)
          Adds values of a plot-point pair (X,Y,Z).
 void clear()
          Clear the container
 P2D copy()
          Get a copy of the current holder
 P2D copy(java.lang.String newtitle)
          create an exact of the current holder
 void fill(double[] xa, double[] ya, double[] za)
          Fill a P2D container from 3 arrays.
 double[] getArrayX()
          Get array representing X-values
 double[] getArrayY()
          Get array representing Y-values
 double[] getArrayZ()
          Get array representing Z-values
 jplot.DataArray2D getDataArray()
          Return a DataArray2D container.
 double getMax(int axis)
          Returns the maximum value in the range.
 double getMin(int axis)
          Returns the minimum value in the range.
 java.awt.Color getSymbolColor()
          Get color attribute
 int getSymbolSize()
          Get size of the symbols
 java.lang.String getTitle()
          Get a new title
 double getX(int i)
          Return a specific X-value.
 double getY(int i)
          Return a specific Y-value.
 double getZ(int i)
          Return a specific Z-value.
 double meanX()
          Returns the mean value in X.
 double meanY()
          Returns the mean value in Y.
 double meanZ()
          Returns the mean value in Z.
 P2D merge(P2D a)
          Merge two P2D containers
 void print()
          Print a P2D container on the screen
 void set(int i, double x, double y, double z)
          Sets the values of (x,y,z).
 void setDataArray(jplot.DataArray2D data)
          Set data in a form of DataArray
 void setSymbolColor(java.awt.Color c)
          Sets symbol color
 void setSymbolSize(int s)
          Sets the symbol size
 void setTitle(java.lang.String title)
          Set a new title
 int size()
          Return the length of the data vector.
 void toFile(java.lang.String name)
          Write a P2D to an external file.
 void toTable()
          Print the P2D container to a Table in a separate Frame.
 void toTable(boolean format)
          Print the P2D container to a Table in a separate Frame.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

P2D

public P2D(java.lang.String title)
Construct an empty container with a title

Parameters:
title - New title

P2D

public P2D()
Construct an empty container with a title


P2D

public P2D(java.lang.String title,
           java.lang.String sfile)
Construct a P2D from a file. Data should be separated by space in 3 columns.

Parameters:
title - Title of the container
sfile - File name with input
Method Detail

setTitle

public void setTitle(java.lang.String title)
Set a new title

Parameters:
title - New Title

getTitle

public java.lang.String getTitle()
Get a new title

Returns:
Title

getSymbolColor

public java.awt.Color getSymbolColor()
Get color attribute

Returns:
Color

setSymbolColor

public void setSymbolColor(java.awt.Color c)
Sets symbol color

Parameters:
c - Color

getSymbolSize

public int getSymbolSize()
Get size of the symbols

Returns:
size of the symbols

setSymbolSize

public void setSymbolSize(int s)
Sets the symbol size

Parameters:
s - symbol size

toFile

public void toFile(java.lang.String name)
Write a P2D to an external file.

Parameters:
name - File name with output

print

public void print()
Print a P2D container on the screen


merge

public P2D merge(P2D a)
Merge two P2D containers

Parameters:
a - Container to be added
Returns:
New P2D container

setDataArray

public void setDataArray(jplot.DataArray2D data)
Set data in a form of DataArray

Parameters:
data - input data

getDataArray

public jplot.DataArray2D getDataArray()
Return a DataArray2D container.

Returns:
Container of type DataArray

add

public void add(double x,
                double y,
                double z)
Adds values of a plot-point pair (X,Y,Z).

Parameters:
x - X-value of the plot-point
y - Y-value of the plot-point
z - Z-value of the plot-point

fill

public void fill(double[] xa,
                 double[] ya,
                 double[] za)
Fill a P2D container from 3 arrays. If it is not empty, add values will be appended. It is assumed that all errors are zero.

Parameters:
xa - array with X values
ya - array with Y values
za - array with Z values

set

public void set(int i,
                double x,
                double y,
                double z)
Sets the values of (x,y,z).

Parameters:
i - index of the plot-point
x - x-value of the plot-point
y - y-value of the plot-point
z - z-value of the plot-point

size

public int size()
Return the length of the data vector.

Returns:
length of the PlotPoint vector

copy

public P2D copy()
Get a copy of the current holder


copy

public P2D copy(java.lang.String newtitle)
create an exact of the current holder

Parameters:
newtitle - new title

getArrayX

public double[] getArrayX()
Get array representing X-values

Returns:
array with X values

getArrayY

public double[] getArrayY()
Get array representing Y-values

Returns:
array with Y values

getArrayZ

public double[] getArrayZ()
Get array representing Z-values

Returns:
array with Y values

getX

public double getX(int i)
Return a specific X-value. This function returns POSINF (1e300) if index i falls beyond the valid range.

Parameters:
i - index of the array
Returns:
the value of x at index i

getY

public double getY(int i)
Return a specific Y-value. This function returns POSINF (1e300) if index i falls beyond the valid range.

Parameters:
i - index of the array
Returns:
the value of y at index i

getZ

public double getZ(int i)
Return a specific Z-value. This function returns POSINF (1e300) if index i falls beyond the valid range.

Parameters:
i - index of the array
Returns:
the value of z at index i

getMax

public double getMax(int axis)
Returns the maximum value in the range.

Parameters:
axis - defines to which axis this function applies. axis=0 - X, axis=1 - Y, axis=2 - Z,
Returns:
the maximum value.

getMin

public double getMin(int axis)
Returns the minimum value in the range. axis=0 - X, axis=1 - Y, axis=2 - Z.

Parameters:
axis - defines to which axis this function applies.
Returns:
the minimum value.

meanX

public double meanX()
Returns the mean value in X.

Returns:
Mean value in X

meanY

public double meanY()
Returns the mean value in Y.

Returns:
Mean value in Y

meanZ

public double meanZ()
Returns the mean value in Z.

Returns:
Mean value in Y

clear

public void clear()
Clear the container


toTable

public void toTable()
Print the P2D container to a Table in a separate Frame. The numbers are formatted to scientific format. One can sort and search the data in this table (but not modify)


toTable

public void toTable(boolean format)
Print the P2D container to a Table in a separate Frame. One can sort and search the data in this table (but not modify)

Parameters:
format - if false, numbers will not be formatted to scientific format ##.#####E00


jHepWork 1.1 (C) Chekanov