jhplot.io
Class HFileDIF
- java.lang.Object
-
- jhplot.io.HFileDIF
-
public class HFileDIF extends java.lang.Object
Write or read data in DIF format. The DIF is data interchange Format (.dif) used to import/export spreadsheets between spreadsheet programs. The files are simple text files that can be readable. Should be used to write main ScaVis data structures and import them to spreadsheet (such as OpenOffice). You can write only one object in one file.
-
-
Constructor Summary
Constructors Constructor and Description HFileDIF(java.lang.String file)
Open file for reading.HFileDIF(java.lang.String file, java.lang.String option)
Open a file to write/read data to/from a DIF file.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description boolean
close()
Close the file if needed.void
doc()
Show online documentation.DIFSheet
read()
Read data as sheet.boolean
write(double[] p)
Write double 1D array into the DIF file.boolean
write(H1D p)
Write 1-D histograms (including errors) into the DIF file.boolean
write(int[] p)
Write double 1D array into the DIF file.boolean
write(P0D p)
Write 1D array into the DIF file.boolean
write(P0I p)
Write 1D array into the DIF file.boolean
write(P1D p)
Write 2D array into the DIF file.boolean
write(PND p)
Write N-dimensional array into the DIF file.boolean
write(PNI p)
Write N-dimensional array into the DIF file.boolean
write(java.lang.String[] p)
Write double 1D array into the DIF file.
-
-
-
Constructor Detail
-
HFileDIF
public HFileDIF(java.lang.String file, java.lang.String option)
Open a file to write/read data to/from a DIF file. If "w" option is set, the old file will be removed. Use close() to flash the buffer and close the file.If the file name starts from http or ftp, we assume it is located on the Web and will attempt to read it from URL.
- Parameters:
file
- File name. Can be located on URL if starts from http or ftp.option
- Option to create the file. If "w" - write a file (or read) file, if "r" only read created file.
-
HFileDIF
public HFileDIF(java.lang.String file)
Open file for reading.- Parameters:
file
- File name
-
-
Method Detail
-
write
public boolean write(double[] p)
Write double 1D array into the DIF file.- Parameters:
p
- input array- Returns:
- true if success
-
write
public boolean write(int[] p)
Write double 1D array into the DIF file.- Parameters:
p
- input array- Returns:
- true if success
-
write
public boolean write(java.lang.String[] p)
Write double 1D array into the DIF file.- Parameters:
p
- input array- Returns:
- true if success
-
write
public boolean write(P0I p)
Write 1D array into the DIF file.- Parameters:
p
- input array- Returns:
- true if success
-
write
public boolean write(P0D p)
Write 1D array into the DIF file.- Parameters:
p
- input array- Returns:
- true if success
-
write
public boolean write(PND p)
Write N-dimensional array into the DIF file.- Parameters:
p
- multidimensional array- Returns:
- true if success
-
write
public boolean write(PNI p)
Write N-dimensional array into the DIF file.- Parameters:
p
- multidimensional (integer) array- Returns:
- true if success
-
write
public boolean write(H1D p)
Write 1-D histograms (including errors) into the DIF file. First 2 columns are lower and upper edges of the bins, 3rd column is height, 4th is the error on the heights.- Parameters:
p
- histogram- Returns:
- true if success
-
write
public boolean write(P1D p)
Write 2D array into the DIF file.- Parameters:
p
- input array- Returns:
- true if success
-
read
public DIFSheet read()
Read data as sheet.- Returns:
- DIFSheet data.
-
close
public boolean close()
Close the file if needed.- Returns:
- true if success
-
doc
public void doc()
Show online documentation.
-
-
DMelt 3.0 © DataMelt by jWork.ORG