Develop clang format java (#1653)
This commit is contained in:
@@ -24,20 +24,21 @@ import hdf.hdf5lib.H5;
|
||||
import hdf.hdf5lib.HDF5Constants;
|
||||
|
||||
public class H5Ex_D_External {
|
||||
private static String FILENAME = "H5Ex_D_External.h5";
|
||||
private static String EXTERNALNAME = "H5Ex_D_External.data";
|
||||
private static String DATASETNAME = "DS1";
|
||||
private static final int DIM_X = 4;
|
||||
private static final int DIM_Y = 7;
|
||||
private static final int RANK = 2;
|
||||
private static String FILENAME = "H5Ex_D_External.h5";
|
||||
private static String EXTERNALNAME = "H5Ex_D_External.data";
|
||||
private static String DATASETNAME = "DS1";
|
||||
private static final int DIM_X = 4;
|
||||
private static final int DIM_Y = 7;
|
||||
private static final int RANK = 2;
|
||||
private static final int NAME_BUF_SIZE = 32;
|
||||
|
||||
private static void writeExternal() {
|
||||
long file_id = HDF5Constants.H5I_INVALID_HID;
|
||||
long dcpl_id = HDF5Constants.H5I_INVALID_HID;
|
||||
private static void writeExternal()
|
||||
{
|
||||
long file_id = HDF5Constants.H5I_INVALID_HID;
|
||||
long dcpl_id = HDF5Constants.H5I_INVALID_HID;
|
||||
long filespace_id = HDF5Constants.H5I_INVALID_HID;
|
||||
long dataset_id = HDF5Constants.H5I_INVALID_HID;
|
||||
long[] dims = { DIM_X, DIM_Y };
|
||||
long dataset_id = HDF5Constants.H5I_INVALID_HID;
|
||||
long[] dims = {DIM_X, DIM_Y};
|
||||
int[][] dset_data = new int[DIM_X][DIM_Y];
|
||||
|
||||
// Initialize the dataset.
|
||||
@@ -48,7 +49,7 @@ public class H5Ex_D_External {
|
||||
// Create a new file using default properties.
|
||||
try {
|
||||
file_id = H5.H5Fcreate(FILENAME, HDF5Constants.H5F_ACC_TRUNC, HDF5Constants.H5P_DEFAULT,
|
||||
HDF5Constants.H5P_DEFAULT);
|
||||
HDF5Constants.H5P_DEFAULT);
|
||||
}
|
||||
catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
@@ -84,7 +85,7 @@ public class H5Ex_D_External {
|
||||
try {
|
||||
if ((file_id >= 0) && (filespace_id >= 0) && (dcpl_id >= 0))
|
||||
dataset_id = H5.H5Dcreate(file_id, DATASETNAME, HDF5Constants.H5T_STD_I32LE, filespace_id,
|
||||
HDF5Constants.H5P_DEFAULT, dcpl_id, HDF5Constants.H5P_DEFAULT);
|
||||
HDF5Constants.H5P_DEFAULT, dcpl_id, HDF5Constants.H5P_DEFAULT);
|
||||
}
|
||||
catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
@@ -92,8 +93,8 @@ public class H5Ex_D_External {
|
||||
|
||||
// Write the dataset.
|
||||
try {
|
||||
H5.H5Dwrite(dataset_id, HDF5Constants.H5T_NATIVE_INT, HDF5Constants.H5S_ALL, HDF5Constants.H5S_ALL,
|
||||
HDF5Constants.H5P_DEFAULT, dset_data);
|
||||
H5.H5Dwrite(dataset_id, HDF5Constants.H5T_NATIVE_INT, HDF5Constants.H5S_ALL,
|
||||
HDF5Constants.H5S_ALL, HDF5Constants.H5P_DEFAULT, dset_data);
|
||||
}
|
||||
catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
@@ -133,15 +134,15 @@ public class H5Ex_D_External {
|
||||
catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private static void readExternal() {
|
||||
long file_id = HDF5Constants.H5I_INVALID_HID;
|
||||
long dcpl_id = HDF5Constants.H5I_INVALID_HID;
|
||||
long dataset_id = HDF5Constants.H5I_INVALID_HID;
|
||||
private static void readExternal()
|
||||
{
|
||||
long file_id = HDF5Constants.H5I_INVALID_HID;
|
||||
long dcpl_id = HDF5Constants.H5I_INVALID_HID;
|
||||
long dataset_id = HDF5Constants.H5I_INVALID_HID;
|
||||
int[][] dset_data = new int[DIM_X][DIM_Y];
|
||||
String[] Xname = new String[1];
|
||||
String[] Xname = new String[1];
|
||||
|
||||
// Open file using the default properties.
|
||||
try {
|
||||
@@ -183,8 +184,8 @@ public class H5Ex_D_External {
|
||||
// Read the data using the default properties.
|
||||
try {
|
||||
if (dataset_id >= 0)
|
||||
H5.H5Dread(dataset_id, HDF5Constants.H5T_NATIVE_INT, HDF5Constants.H5S_ALL, HDF5Constants.H5S_ALL,
|
||||
HDF5Constants.H5P_DEFAULT, dset_data);
|
||||
H5.H5Dread(dataset_id, HDF5Constants.H5T_NATIVE_INT, HDF5Constants.H5S_ALL,
|
||||
HDF5Constants.H5S_ALL, HDF5Constants.H5P_DEFAULT, dset_data);
|
||||
}
|
||||
catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
@@ -227,9 +228,9 @@ public class H5Ex_D_External {
|
||||
}
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
public static void main(String[] args)
|
||||
{
|
||||
H5Ex_D_External.writeExternal();
|
||||
H5Ex_D_External.readExternal();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user