public class HBook extends Object
The file extension of HBook is "jdat".
Generally, however, use HFile or Serialized class to keep objects to read and write objects in a serialized form.
Constructor and Description |
---|
HBook(String file)
Initialize HBook class for reading a file.
|
HBook(String file,
String option)
Initialize HBook and tell what to do.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Clear all objects and exit.
|
void |
doc()
Show online documentation.
|
Object |
get(String id)
Get an object using the key
|
Map<String,Object> |
getAll()
Get all objects as a map
|
String[] |
getKeys()
Return array of all know keys
|
String |
getTimeCreation()
Return time of file creation.
|
int |
getVersion()
Get version of the file.
|
void |
setDescription(String description)
Set a desciption which will be attached to the header of the output file.
|
void |
setFormat(DecimalFormat dfb)
Set format for writting double values.
|
void |
write(int id,
Object ob)
Write jhplot data container.
|
void |
write(Object ob)
Add any object.
|
void |
write(String id,
double[] a)
add 1D array
|
void |
write(String id,
double[][] a)
add 2D array
|
void |
write(String id,
F1D f1)
write F1D function
|
void |
write(String id,
F2D f2)
write F2D function
|
void |
write(String id,
FND a)
add 2D array
|
void |
write(String id,
FPR f1)
write FPR parametric function
|
void |
write(String id,
H1D h1d)
write H1D histogram to HBook
|
void |
write(String id,
H2D h2d)
write H2D histogram to HBook
|
void |
write(String id,
int[] a)
add 1D array
|
void |
write(String id,
int[][] a)
add 2D array
|
void |
write(String id,
P0D pnd)
add P0D data object.
|
void |
write(String id,
P0I pnd)
add P0I data object.
|
void |
write(String id,
P1D p1d)
add P1D histogram to HBook
|
void |
write(String id,
P2D pnd)
add P2D data object.
|
void |
write(String id,
PND pnd)
add PND data object.
|
void |
write(String id,
PNI pnd)
add PID data object.
|
public HBook(String file, String option)
file
- file for reading or writingoption
- can be "r" (read) or "w" (write).public HBook(String file)
file
- input file for reading (can be URL).public void setFormat(DecimalFormat dfb)
dfb
- writing format.public void setDescription(String description)
description
- description.public int getVersion()
public Object get(String id)
id
- key for object accesspublic String[] getKeys()
public void write(String id, H1D h1d)
id
- key to be assignedh1d
- H1D histogram to be addedpublic void write(String id, H2D h2d)
id
- key to be assignedh2d
- H2D histogram to be addedpublic void write(String id, P1D p1d)
id
- key to be assignedp1d
- P1D histogram to be addedpublic void write(String id, PND pnd)
id
- key to be assignedpnd
- PND histogram to be addedpublic void write(String id, PNI pnd)
id
- key to be assignedpnd
- PID histogram to be addedpublic void write(String id, P0D pnd)
id
- key to be assignedpnd
- P0D histogram to be addedpublic void write(String id, P0I pnd)
id
- key to be assignedpnd
- P0D histogram to be addedpublic void write(String id, P2D pnd)
id
- key to be assignedpnd
- P2D histogram to be addedpublic void write(Object ob)
obj
- object for writing.public void write(int id, Object ob)
id
- integer keyobj
- objectpublic void write(String id, F1D f1)
id
- key to be assignedf1
- functionpublic void write(String id, FPR f1)
id
- key to be assignedf1
- functionpublic void write(String id, F2D f2)
id
- key to be assignedf2
- functionpublic void write(String id, double[] a)
id
- key to be assigneda
- arraypublic void write(String id, int[] a)
id
- key to be assigneda
- arraypublic void write(String id, double[][] a)
id
- key to be assigneda
- arraypublic void write(String id, int[][] a)
id
- key to be assigneda
- arraypublic void write(String id, FND a)
id
- key to be assigneda
- arraypublic void close()
public void doc()
public String getTimeCreation()
Jas4pp 1.5 © Java Analysis Studio for Particle Physics