-
Notifications
You must be signed in to change notification settings - Fork 0
Add FileAddress interface #28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Removes the current implementation of FileAddress in favor of a interface to make our framework more general. In addition, an internal package for current implementation was added until we organize the code in a better way, with the address classes moved there.
Codecov Report
@@ Coverage Diff @@
## master #28 +/- ##
============================================
- Coverage 87.97% 85.42% -2.56%
- Complexity 65 73 +8
============================================
Files 8 9 +1
Lines 183 199 +16
Branches 19 21 +2
============================================
+ Hits 161 170 +9
- Misses 19 25 +6
- Partials 3 4 +1
Continue to review full report at Codecov.
|
magicDGS
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The interface should not enforce cached bytes.
|
|
||
|
|
||
| /** | ||
| * Gets the number of bytes used to encode this file address into a byte array with {@link |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move link to different line.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed.
| /** | ||
| * Seeks the byte chanel to the file pointer position. | ||
| * | ||
| * |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove extra empty line
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
| * Seeks the byte chanel to the file pointer position. | ||
| * | ||
| * | ||
| * <p>Default implementation returns the byte channel after calling {@link |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move link to next line.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
| } | ||
|
|
||
| /** | ||
| * Returns {@code true} if the two addresses point to the same position in the file; {@code |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move the last {@code to the next line
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
| * does not support | ||
| * this field. | ||
| * @see org.magicdgs.hdf5j.fileformat.address.FileAddressManager#getUndefinedAddress() | ||
| * @see org.magicdgs.hdf5j.internal.address.FileAddressManager |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should point to the FileAddress.UNDEFINED_FILE_POINTER.
| * | ||
| * @return byte array in big-endian order to encode the address. | ||
| */ | ||
| public byte[] asByteArray(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd vote for change the signature to asByteArray(int numberOfBytes) to be able to encode it with different number of bytes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
| * | ||
| * @return the number of bytes used to encode this file address position. | ||
| */ | ||
| public int getNumberOfBytes(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I vote for remove the encapsulation of the number of bytes into the file address in the interface.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed.
| * | ||
| * @return address hexadecimal representation. | ||
| */ | ||
| public default String hexDisplay() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the asByteArray signature changes, remove default behavior and point to the static method for a common implementation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
Removes the current implementation of FileAddress in favor of a interface to make our framework more general.
In addition, an internal package for current implementation was added until we organize the code in a better way, with the address classes moved there.
Closes #24