|
|||||||||
PREV CLASS NEXT CLASS | All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjhplot.PNI
public class PNI
/** A container to hold data points in many dimensions. All numbers are expected to be integers. It extends ArrayList and adds many new features for data manipulation. The class does not have graphical option (use H1D to show the data or methods of this class which transform P0D to a H1D histogram).
Constructor Summary | |
---|---|
PNI()
Construct an empty container with no title |
|
PNI(java.lang.String title)
Construct an empty container with a title |
|
PNI(java.lang.String title,
boolean shallow,
PNI PNI)
Construct a copy from a PNI. |
|
PNI(java.lang.String title,
java.lang.String file)
Construct a container with a title from external file (see the method toFile() how to write such ASCII file) |
Method Summary | |
---|---|
void |
add(int[] values)
Adds (appends) the specified element to the end of this list. |
void |
add(P0I values)
Adds (appends) P0D to the end of this list. |
void |
clear()
Clear the container |
PNI |
copy(java.lang.String newtitle)
Create an exact copy of the current P0D. |
void |
doc()
Show online documentation. |
int[] |
get(int row)
Return a specific row as array |
int |
get(int row,
int column)
Return a specific value. |
int[][] |
getArray()
Get a double array with values. |
java.util.ArrayList<int[]> |
getArrayList()
Get data in form of ArrayList |
P0D |
getColumn(int column)
Return a specific column as array |
int |
getDimension()
Get last dimension of the data. |
hep.aida.IDataPointSet |
getIDataPointSet()
Get the data point set for JAIDA |
P0D |
getRow(int row)
Return a specific row as array |
PNI |
getRows(java.lang.String newtitle,
int indexMin,
int indexMax)
Get rows : min is inxluded, max is not; |
java.lang.String |
getTitle()
Get a new title |
static void |
main(java.lang.String[] args)
Test |
PNI |
oper(PNI PNI,
java.lang.String what)
Operations on PNI containers: add, subtract, multiply, divide. |
PNI |
oper(PNI PNI,
java.lang.String title,
java.lang.String what)
Operations on PNI containers: add, subtract, multiply, divide. |
void |
operScale(double scale)
Scale each element of data |
void |
print()
Print PNI to System.out. |
int |
read(java.lang.String sfile)
Read the data from external file. |
int |
readGZip(java.lang.String sfile)
Read the data from external GZipped file. |
PNI |
readSerialized(java.lang.String name)
Read a PNI object from a serialized file |
int |
readZip(java.lang.String sfile)
Read the data from ZIPed external file. |
PNI |
remove(int index)
Remove a row |
void |
set(int index,
int[] values)
Sets (replace) the specified row. |
void |
set(int index,
P0I values)
Sets (replace) the specified element with P0D. |
PNI |
setArray(int[][] values)
Set values from double array Old content will be lost. |
void |
setArrayList(java.util.ArrayList<int[]> array)
Set the data in form of ArrayList |
void |
setTitle(java.lang.String title)
Set a new title |
int |
size()
Data size (number of rows) |
void |
toFile(java.lang.String name)
Write a PNI to an external file. |
java.lang.String |
toString()
Get a string representing PNI |
void |
write(java.lang.String name)
Write a PNI to an external file. |
int |
writeSerialized(java.lang.String name)
Write a P0D object to a serialized file |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public PNI(java.lang.String title)
title
- A titlepublic PNI(java.lang.String title, boolean shallow, PNI PNI)
title
- new titleshallow
- if true, a shallow copy of a collection.PNI
- inpit datapublic PNI(java.lang.String title, java.lang.String file)
title
- A titlefile
- input file namepublic PNI()
Method Detail |
---|
public void setTitle(java.lang.String title)
title
- New Titlepublic java.lang.String getTitle()
public void clear()
public int[] get(int row)
row
- index of the row
public int get(int row, int column)
row
- row indexcolumn
- column index
public java.lang.String toString()
toString
in class java.lang.Object
public void print()
public P0D getColumn(int column)
column
- index of the column
public int getDimension()
public P0D getRow(int row)
row
- index of the row
public java.util.ArrayList<int[]> getArrayList()
public hep.aida.IDataPointSet getIDataPointSet()
public void add(int[] values)
values
- array of values to be added.public void add(P0I values)
values
- array of values to be added.public void set(int index, int[] values)
index
- position indexvalues
- array of values to be added.public void set(int index, P0I values)
index
- position indexvalues
- array of values to be added.public int read(java.lang.String sfile)
sfile
- File name with input
public int readGZip(java.lang.String sfile)
sfile
- File name with input (.gz extension)
public int readZip(java.lang.String sfile)
sfile
- File name with the input (extension .zip)
public void write(java.lang.String name)
name
- File name with outputpublic int writeSerialized(java.lang.String name)
name
- serialized file name for output.
public PNI readSerialized(java.lang.String name)
name
- serialized file name for input.
public void toFile(java.lang.String name)
name
- File name with outputpublic PNI remove(int index)
index
- row index to be removedpublic PNI oper(PNI PNI, java.lang.String what)
PNI
- Input PNI container for operationwhat
- String representing the operation: "+" add a P0D container to
the original; "-" subtract a P0D from the original; "*"
multiply; "/" divide by P0D
public PNI oper(PNI PNI, java.lang.String title, java.lang.String what)
PNI
- Input PNI container for operationtitle
- New titlewhat
- String representing the operation: "+" add a P0D container to
the original; "-" subtract a P0D from the original; "*"
multiply; "/" divide by P0D
public void operScale(double scale)
scale
- Scale factorpublic int size()
public PNI copy(java.lang.String newtitle)
newtitle
- new titlepublic PNI getRows(java.lang.String newtitle, int indexMin, int indexMax)
title
- New titleindexMin
- min index of rowindexMax
- max index of row
public void setArrayList(java.util.ArrayList<int[]> array)
array
- ArrayList to be set.public int[][] getArray()
public PNI setArray(int[][] values)
values
- array to be set: [ROWS][dimension];
public static void main(java.lang.String[] args)
args
- public void doc()
|
|||||||||
PREV CLASS NEXT CLASS | All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |