|
13 | 13 | import java.nio.ByteBuffer; |
14 | 14 | import java.nio.ByteOrder; |
15 | 15 | import java.nio.channels.SeekableByteChannel; |
16 | | -import java.util.ArrayList; |
17 | | -import java.util.List; |
18 | | -import java.util.Optional; |
| 16 | +import java.util.*; |
19 | 17 |
|
20 | 18 | /** |
21 | 19 | * Represents a leaf node (HdfDataset) in the B-Tree. |
@@ -163,7 +161,31 @@ private record ChunkedReadContext( |
163 | 161 | long endElement, |
164 | 162 | Optional<FilterPipelineMessage> filterPipeline, |
165 | 163 | FillValueMessage fillValueMessage |
166 | | - ) {} |
| 164 | + ) { |
| 165 | + @Override |
| 166 | + public boolean equals(Object o) { |
| 167 | + if (o == null || getClass() != o.getClass()) return false; |
| 168 | + ChunkedReadContext that = (ChunkedReadContext) o; |
| 169 | + return dimensions == that.dimensions && endElement == that.endElement && elementSize == that.elementSize && startElement == that.startElement && Objects.deepEquals(chunkDims, that.chunkDims) && Objects.deepEquals(datasetDims, that.datasetDims); |
| 170 | + } |
| 171 | + |
| 172 | + @Override |
| 173 | + public int hashCode() { |
| 174 | + return Objects.hash(dimensions, Arrays.hashCode(datasetDims), Arrays.hashCode(chunkDims), elementSize, startElement, endElement); |
| 175 | + } |
| 176 | + |
| 177 | + @Override |
| 178 | + public String toString() { |
| 179 | + return "ChunkedReadContext{" + |
| 180 | + "dimensions=" + dimensions + |
| 181 | + ", datasetDims=" + Arrays.toString(datasetDims) + |
| 182 | + ", chunkDims=" + Arrays.toString(chunkDims) + |
| 183 | + ", elementSize=" + elementSize + |
| 184 | + ", startElement=" + startElement + |
| 185 | + ", endElement=" + endElement + |
| 186 | + '}'; |
| 187 | + } |
| 188 | + } |
167 | 189 |
|
168 | 190 | // In the method: |
169 | 191 | public synchronized ByteBuffer getDatasetData(SeekableByteChannel channel, long offset, long size) throws IOException, InvocationTargetException, InstantiationException, IllegalAccessException { |
|
0 commit comments