Skip to content

Commit 5bc06a7

Browse files
committed
Updates
1 parent 25717bb commit 5bc06a7

13 files changed

Lines changed: 71 additions & 71 deletions

File tree

src/main/java/org/hdf5javalib/dataclass/reference/HdfDatasetRegionReference.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
import org.hdf5javalib.dataclass.HdfFixedPoint;
44
import org.hdf5javalib.datatype.FixedPointDatatype;
55
import org.hdf5javalib.datatype.ReferenceDatatype;
6-
import org.hdf5javalib.hdfjava.HdfBTree;
7-
import org.hdf5javalib.hdfjava.HdfBTreeNode;
6+
import org.hdf5javalib.hdfjava.HdfTree;
7+
import org.hdf5javalib.hdfjava.HdfTreeNode;
88
import org.hdf5javalib.hdfjava.HdfDataObject;
99
import org.hdf5javalib.utils.HdfDataHolder;
1010

@@ -37,8 +37,8 @@ public HdfDatasetRegionReference(byte[] bytes, ReferenceDatatype dt, boolean ext
3737
dataspaceSelectionInstance = HdfDataspaceSelectionInstance.parseSelectionInfo(remaingData);
3838

3939
AtomicReference<HdfDataObject> localHdfDataObject = new AtomicReference<>();
40-
HdfBTree bTree = dt.getDataFile().getBTree();
41-
for (HdfBTreeNode node : bTree) {
40+
HdfTree bTree = dt.getDataFile().getBTree();
41+
for (HdfTreeNode node : bTree) {
4242
HdfFixedPoint objectOffset = node.getDataObject().getObjectHeader().getOffset();
4343
if (objectOffset.compareTo(localHdfFixedPoint) == 0) {
4444
localHdfDataObject.set(node.getDataObject());

src/main/java/org/hdf5javalib/dataclass/reference/HdfObjectReference.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
import org.hdf5javalib.datatype.ReferenceDatatype;
77
import org.hdf5javalib.datatype.StringDatatype;
88
import org.hdf5javalib.hdffile.metadata.HdfSuperblock;
9-
import org.hdf5javalib.hdfjava.HdfBTree;
10-
import org.hdf5javalib.hdfjava.HdfBTreeNode;
9+
import org.hdf5javalib.hdfjava.HdfTree;
10+
import org.hdf5javalib.hdfjava.HdfTreeNode;
1111
import org.hdf5javalib.hdfjava.HdfDataObject;
1212
import org.hdf5javalib.utils.HdfDataHolder;
1313

@@ -82,8 +82,8 @@ public HdfObjectReference(byte[] bytes, ReferenceDatatype dt, boolean external)
8282
} else {
8383
throw new IllegalArgumentException("Unsupported reference type: " + dt.getClassBitField());
8484
}
85-
HdfBTree bTree = dt.getDataFile().getBTree();
86-
for (HdfBTreeNode node : bTree) {
85+
HdfTree bTree = dt.getDataFile().getBTree();
86+
for (HdfTreeNode node : bTree) {
8787
HdfFixedPoint objectOffset = node.getDataObject().getObjectHeader().getOffset();
8888
if (objectOffset.compareTo(localHdfFixedPoint) == 0) {
8989
localHdfDataObject.set(node.getDataObject());

src/main/java/org/hdf5javalib/hdffile/dataobjects/messages/DataLayoutMessage.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -199,11 +199,11 @@ public static HdfMessage parseHeaderMessage(int flags, byte[] data, HdfDataFile
199199
}
200200

201201
/**
202-
* Reads an HdfBTree from a file channel.
202+
* Reads an HdfTree from a file channel.
203203
*
204204
* @param fileChannel the file channel to read from
205205
* @param hdfDataFile the HDF5 file context
206-
* @return the constructed HdfBTree instance
206+
* @return the constructed HdfTree instance
207207
* @throws IOException if an I/O error occurs or the B-Tree data is invalid
208208
*/
209209
public static HdfBTreeV1 readBTreeFromSeekableByteChannel(
@@ -217,13 +217,13 @@ public static HdfBTreeV1 readBTreeFromSeekableByteChannel(
217217
}
218218

219219
/**
220-
* Recursively reads an HdfBTree from a file channel, handling cycles.
220+
* Recursively reads an HdfTree from a file channel, handling cycles.
221221
*
222222
* @param fileChannel the file channel to read from
223223
* @param nodeAddress the address of the current node
224224
* @param visitedNodes a map of visited node addresses to detect cycles
225225
* @param hdfDataFile the HDF5 file context
226-
* @return the constructed HdfBTree instance
226+
* @return the constructed HdfTree instance
227227
* @throws IOException if an I/O error occurs or the B-Tree data is invalid
228228
*/
229229
private static HdfBTreeV1 readFromSeekableByteChannelRecursive(SeekableByteChannel fileChannel,

src/main/java/org/hdf5javalib/hdffile/infrastructure/HdfBTreeEntryBase.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public HdfBTreeV1 getChildBTree() {
5353
// * @param childBTreeAddress the address of the child B-Tree
5454
// * @param childBTree the child B-Tree payload
5555
// */
56-
// public HdfGroupBTreeEntry(HdfFixedPoint key, HdfFixedPoint childBTreeAddress, HdfBTree childBTree) {
56+
// public HdfGroupBTreeEntry(HdfFixedPoint key, HdfFixedPoint childBTreeAddress, HdfTree childBTree) {
5757
// this.key = key;
5858
// this.childPointer = childBTreeAddress;
5959
// this.symbolTableNode = null;

src/main/java/org/hdf5javalib/hdffile/infrastructure/HdfBTreeV1.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
/**
1212
* Represents an HDF5 B-Tree (version 1) as defined in the HDF5 specification.
1313
* <p>
14-
* The {@code HdfBTree} class models a B-Tree used for indexing group entries in HDF5 files.
14+
* The {@code HdfTree} class models a B-Tree used for indexing group entries in HDF5 files.
1515
* It supports both leaf nodes (containing symbol table nodes) and internal nodes (containing
1616
* child B-Trees). This class provides methods for reading from a file channel, adding datasets,
1717
* splitting symbol table nodes, and writing the B-Tree structure back to a file.
@@ -56,7 +56,7 @@ public class HdfBTreeV1 {
5656
private final HdfDataFile hdfDataFile;
5757

5858
/**
59-
* Constructs an HdfBTree with all fields specified.
59+
* Constructs an HdfTree with all fields specified.
6060
*
6161
* @param nodeType the type of the node (0 for group B-Tree)
6262
* @param nodeLevel the level of the node (0 for leaf, >0 for internal)
@@ -88,7 +88,7 @@ public HdfBTreeV1(
8888
}
8989

9090
/**
91-
* Constructs an HdfBTree with minimal fields for a new node.
91+
* Constructs an HdfTree with minimal fields for a new node.
9292
*
9393
* @param nodeType the type of the node (0 for group B-Tree)
9494
* @param nodeLevel the level of the node (0 for leaf, >0 for internal)
@@ -115,14 +115,14 @@ public HdfBTreeV1(
115115
}
116116

117117
/**
118-
* Returns a string representation of the HdfBTree.
118+
* Returns a string representation of the HdfTree.
119119
*
120120
* @return a string describing the node's signature, type, level, entries, and structure
121121
*/
122122
@Override
123123
public String toString() {
124124
StringBuilder sb = new StringBuilder();
125-
sb.append("HdfBTree{");
125+
sb.append("HdfTree{");
126126
sb.append("signature='").append("TREE").append('\'');
127127
sb.append(", nodeType=").append(nodeType);
128128
sb.append(", nodeLevel=").append(nodeLevel);

src/main/java/org/hdf5javalib/hdffile/infrastructure/HdfGroupBTreeEntry.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public HdfGroupSymbolTableNode getGroupSymbolTableNode() {
5555
// return symbolTableNode;
5656
// }
5757
//
58-
// public HdfBTree getChildBTree() {
58+
// public HdfTree getChildBTree() {
5959
// return childBTree;
6060
// }
6161
}

src/main/java/org/hdf5javalib/hdfjava/HdfDataFile.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,6 @@ public interface HdfDataFile {
3636
*/
3737
HdfSuperblock getSuperblock();
3838

39-
HdfBTree getBTree();
39+
HdfTree getBTree();
4040

4141
}

src/main/java/org/hdf5javalib/hdfjava/HdfDataObject.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,17 @@
55
import java.util.Objects;
66

77
/**
8-
* An abstract base class for HdfBTreeNode implementations, providing common
8+
* An abstract base class for HdfTreeNode implementations, providing common
99
* properties and the comparison logic based on the node's name.
1010
*/
11-
public abstract class HdfDataObject implements HdfBTreeNode {
11+
public abstract class HdfDataObject implements HdfTreeNode {
1212

1313
protected final String objectName;
1414
protected final HdfObjectHeaderPrefix objectHeader;
15-
protected HdfBTreeNode parent;
15+
protected HdfTreeNode parent;
1616
protected final String hardLink;
1717

18-
public HdfDataObject(String objectName, HdfObjectHeaderPrefix objectHeader, HdfBTreeNode parent, String hardLink) {
18+
public HdfDataObject(String objectName, HdfObjectHeaderPrefix objectHeader, HdfTreeNode parent, String hardLink) {
1919
this.objectName = Objects.requireNonNull(objectName, "Node name cannot be null.");
2020
if (objectName.contains("/")) {
2121
throw new IllegalArgumentException("Node name cannot contain '/' character.");
@@ -31,9 +31,9 @@ public HdfDataObject(String objectName, HdfObjectHeaderPrefix objectHeader, HdfB
3131
@Override
3232
public HdfObjectHeaderPrefix getObjectHeader() { return objectHeader; }
3333
@Override
34-
public HdfBTreeNode getParent() { return parent; }
34+
public HdfTreeNode getParent() { return parent; }
3535
@Override
36-
public void setParent(HdfBTreeNode parent) { this.parent = parent; }
36+
public void setParent(HdfTreeNode parent) { this.parent = parent; }
3737
@Override
3838
public String getObjectPath() {
3939
StringBuilder path = new StringBuilder(Objects.requireNonNull(objectName, "Node name cannot be null."));
@@ -55,7 +55,7 @@ public String getObjectPath() {
5555
* is less than, equal to, or greater than the specified node's name.
5656
*/
5757
@Override
58-
public final int compareTo(HdfBTreeNode other) {
58+
public final int compareTo(HdfTreeNode other) {
5959
return this.objectName.compareTo(other.getObjectName());
6060
}
6161

src/main/java/org/hdf5javalib/hdfjava/HdfDataset.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
*/
2323
public class HdfDataset extends HdfDataObject implements AutoCloseable {
2424

25-
public HdfDataset(String objectName, HdfObjectHeaderPrefix objectHeader, HdfBTreeNode parent, String hardLink) {
25+
public HdfDataset(String objectName, HdfObjectHeaderPrefix objectHeader, HdfTreeNode parent, String hardLink) {
2626
super(objectName, objectHeader, parent, hardLink);
2727
}
2828

src/main/java/org/hdf5javalib/hdfjava/HdfFileReader.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public class HdfFileReader implements HdfDataFile {
5959
* The file allocation manager for tracking storage blocks.
6060
*/
6161
private HdfSuperblock superblock;
62-
private HdfBTree bTree;
62+
private HdfTree bTree;
6363

6464
/**
6565
* Constructs an HdfFileReader for reading an HDF5 file.
@@ -109,7 +109,7 @@ public HdfFileReader readFile() throws Exception {
109109
String groupName = localHeap.stringAtOffset(rootGroupSymbolTableEntry.getLinkNameOffset());
110110
// set BTree
111111
HdfGroup groupObject = new HdfGroup(groupName, objectHeader, null, null);
112-
bTree = new HdfBTree(groupObject);
112+
bTree = new HdfTree(groupObject);
113113
// recurse through infrastructure
114114
readInfrastructure(groupObject, localHeap, groupBTree);
115115

@@ -262,7 +262,7 @@ public <T extends HdfDataObject> Optional<T> getHdfDataObject(String path, Class
262262
HdfGroup currentGroup = bTree.getRoot();
263263
int compIndex = 0;
264264
while (currentGroup != null) {
265-
Optional<HdfBTreeNode> child = currentGroup.findChildByName(components[compIndex++]);
265+
Optional<HdfTreeNode> child = currentGroup.findChildByName(components[compIndex++]);
266266
if ( child.isEmpty() ) {
267267
return Optional.empty();
268268
} else if (compIndex == components.length && clazz.isAssignableFrom(child.get().getDataObject().getClass())) {
@@ -381,11 +381,11 @@ public static HdfSuperblock readSuperblockFromSeekableByteChannel(SeekableByteCh
381381
}
382382

383383
/**
384-
* Reads an HdfBTree from a file channel.
384+
* Reads an HdfTree from a file channel.
385385
*
386386
* @param fileChannel the file channel to read from
387387
* @param hdfDataFile the HDF5 file context
388-
* @return the constructed HdfBTree instance
388+
* @return the constructed HdfTree instance
389389
* @throws IOException if an I/O error occurs or the B-Tree data is invalid
390390
*/
391391
public static HdfBTreeV1 readBTreeFromSeekableByteChannel(
@@ -397,13 +397,13 @@ public static HdfBTreeV1 readBTreeFromSeekableByteChannel(
397397
}
398398

399399
/**
400-
* Recursively reads an HdfBTree from a file channel, handling cycles.
400+
* Recursively reads an HdfTree from a file channel, handling cycles.
401401
*
402402
* @param fileChannel the file channel to read from
403403
* @param nodeAddress the address of the current node
404404
* @param visitedNodes a map of visited node addresses to detect cycles
405405
* @param hdfDataFile the HDF5 file context
406-
* @return the constructed HdfBTree instance
406+
* @return the constructed HdfTree instance
407407
* @throws IOException if an I/O error occurs or the B-Tree data is invalid
408408
*/
409409
private static HdfBTreeV1 readFromSeekableByteChannelRecursive(SeekableByteChannel fileChannel,
@@ -891,7 +891,7 @@ public HdfSuperblock getSuperblock() {
891891
}
892892

893893
@Override
894-
public HdfBTree getBTree() {
894+
public HdfTree getBTree() {
895895
return bTree;
896896
}
897897

0 commit comments

Comments
 (0)