@Test void testCreatingBTreeOfDataTypeWithGroupThrows() { assertThrows(HdfException.class, () -> BTreeV1.createDataBTree(hdfFc, 136, 1245)); }
public static BTreeV1Data createDataBTree(HdfFileChannel hdfFc, long address, int dataDimensions) { ByteBuffer header = readHeaderAndValidateSignature(hdfFc, address); final byte nodeType = header.get(); if (nodeType != 1) { throw new HdfException("B tree type is not data. Type is: " + nodeType); } final byte nodeLevel = header.get(); if (nodeLevel > 0) { return new BTreeV1Data.BTreeV1DataNonLeafNode(hdfFc, address, dataDimensions); } else { return new BTreeV1Data.BTreeV1DataLeafNode(hdfFc, address, dataDimensions); } }
BTreeV1 { public static BTreeV1Data createDataBTree(HdfFileChannel hdfFc, long address, int dataDimensions) { ByteBuffer header = readHeaderAndValidateSignature(hdfFc, address); final byte nodeType = header.get(); if (nodeType != 1) { throw new HdfException("B tree type is not data. Type is: " + nodeType); } final byte nodeLevel = header.get(); if (nodeLevel > 0) { return new BTreeV1Data.BTreeV1DataNonLeafNode(hdfFc, address, dataDimensions); } else { return new BTreeV1Data.BTreeV1DataLeafNode(hdfFc, address, dataDimensions); } } }
BTreeV1 { public static BTreeV1Data createDataBTree(HdfFileChannel hdfFc, long address, int dataDimensions) { ByteBuffer header = readHeaderAndValidateSignature(hdfFc, address); final byte nodeType = header.get(); if (nodeType != 1) { throw new HdfException("B tree type is not data. Type is: " + nodeType); } final byte nodeLevel = header.get(); if (nodeLevel > 0) { return new BTreeV1Data.BTreeV1DataNonLeafNode(hdfFc, address, dataDimensions); } else { return new BTreeV1Data.BTreeV1DataLeafNode(hdfFc, address, dataDimensions); } } BTreeV1(HdfFileChannel hdfFc, long address); }
BTreeV1 { public static BTreeV1Data createDataBTree(HdfFileChannel hdfFc, long address, int dataDimensions) { ByteBuffer header = readHeaderAndValidateSignature(hdfFc, address); final byte nodeType = header.get(); if (nodeType != 1) { throw new HdfException("B tree type is not data. Type is: " + nodeType); } final byte nodeLevel = header.get(); if (nodeLevel > 0) { return new BTreeV1Data.BTreeV1DataNonLeafNode(hdfFc, address, dataDimensions); } else { return new BTreeV1Data.BTreeV1DataLeafNode(hdfFc, address, dataDimensions); } } BTreeV1(HdfFileChannel hdfFc, long address); static BTreeV1Group createGroupBTree(HdfFileChannel hdfFc, long address); static BTreeV1Data createDataBTree(HdfFileChannel hdfFc, long address, int dataDimensions); static ByteBuffer readHeaderAndValidateSignature(HdfFileChannel fc, long address); int getEntriesUsed(); long getLeftSiblingAddress(); long getRightSiblingAddress(); long getAddress(); abstract List<Long> getChildAddresses(); }
BTreeV1 { public static BTreeV1Data createDataBTree(HdfFileChannel hdfFc, long address, int dataDimensions) { ByteBuffer header = readHeaderAndValidateSignature(hdfFc, address); final byte nodeType = header.get(); if (nodeType != 1) { throw new HdfException("B tree type is not data. Type is: " + nodeType); } final byte nodeLevel = header.get(); if (nodeLevel > 0) { return new BTreeV1Data.BTreeV1DataNonLeafNode(hdfFc, address, dataDimensions); } else { return new BTreeV1Data.BTreeV1DataLeafNode(hdfFc, address, dataDimensions); } } BTreeV1(HdfFileChannel hdfFc, long address); static BTreeV1Group createGroupBTree(HdfFileChannel hdfFc, long address); static BTreeV1Data createDataBTree(HdfFileChannel hdfFc, long address, int dataDimensions); static ByteBuffer readHeaderAndValidateSignature(HdfFileChannel fc, long address); int getEntriesUsed(); long getLeftSiblingAddress(); long getRightSiblingAddress(); long getAddress(); abstract List<Long> getChildAddresses();  }