2929public class HdfDisplayUtils {
3030 private static final Logger log = LoggerFactory .getLogger (HdfDisplayUtils .class );
3131 public static final String UNDEFINED = "<Undefined>" ;
32+ private static final String READ_EQUALS = " read = " ;
33+ private static final String STREAM_EQUALS = " stream = " ;
3234
3335 // Define a functional interface for actions that may need channel, dataset, and reader
3436 @ FunctionalInterface
@@ -69,7 +71,7 @@ public static void displayFileAttr(Path filePath) {
6971 }
7072
7173 public static void displayFile (Path filePath ) {
72- processFile (filePath , ( channel , dataSet , reader ) -> displayData ( channel , dataSet , reader ) );
74+ processFile (filePath , HdfDisplayUtils :: displayData );
7375 }
7476
7577 public static void displayAttributes (HdfDataset dataSet ) {
@@ -126,10 +128,10 @@ public static <T> void displayScalarData(SeekableByteChannel fileChannel, HdfDat
126128 TypedDataSource <T > dataSource = new TypedDataSource <>(fileChannel , hdfDataFile , dataSet , clazz );
127129
128130 T result = dataSource .readScalar ();
129- System .out .println (dataSet .getObjectName () + ":" + displayType (clazz , result ) + " read = " + displayValue (result ));
131+ System .out .println (dataSet .getObjectName () + ":" + displayType (clazz , result ) + READ_EQUALS + displayValue (result ));
130132
131133 result = dataSource .streamScalar ().findFirst ().orElseThrow ();
132- System .out .println (dataSet .getObjectName () + ":" + displayType (clazz , result ) + " stream = " + displayValue (result ));
134+ System .out .println (dataSet .getObjectName () + ":" + displayType (clazz , result ) + STREAM_EQUALS + displayValue (result ));
133135 }
134136
135137 /**
@@ -151,9 +153,9 @@ public static <T> void displayVectorData(SeekableByteChannel fileChannel, HdfDat
151153 TypedDataSource <T > dataSource = new TypedDataSource <>(fileChannel , hdfDataFile , dataSet , clazz );
152154
153155 T [] resultArray = dataSource .readVector ();
154- System .out .println (displayType (clazz , resultArray ) + " read = " + displayValue (resultArray ));
156+ System .out .println (displayType (clazz , resultArray ) + READ_EQUALS + displayValue (resultArray ));
155157
156- System .out .print (displayType (clazz , resultArray ) + " stream = [" );
158+ System .out .print (displayType (clazz , resultArray ) + STREAM_EQUALS );
157159 String joined = dataSource .streamVector ()
158160 .map (HdfDisplayUtils ::displayValue )
159161 .collect (Collectors .joining (", " ));
@@ -180,9 +182,9 @@ public static <T> void displayMatrixData(SeekableByteChannel fileChannel, HdfDat
180182 TypedDataSource <T > dataSource = new TypedDataSource <>(fileChannel , hdfDataFile , dataSet , clazz );
181183
182184 T [][] resultArray = dataSource .readMatrix ();
183- System .out .println (displayType (clazz , resultArray ) + " read = " + displayValue (resultArray ));
185+ System .out .println (displayType (clazz , resultArray ) + READ_EQUALS + displayValue (resultArray ));
184186
185- System .out .print (displayType (clazz , resultArray ) + " stream = [" );
187+ System .out .print (displayType (clazz , resultArray ) + STREAM_EQUALS );
186188 String joined = dataSource .streamMatrix ()
187189 .map (HdfDisplayUtils ::displayValue )
188190 .collect (Collectors .joining (", " ));
0 commit comments