Skip to content

Conversation

@magicDGS
Copy link
Owner

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

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-io
Copy link

codecov-io commented Sep 19, 2017

Codecov Report

Merging #28 into master will decrease coverage by 2.55%.
The diff coverage is 88.88%.

Impacted file tree graph

@@             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
Impacted Files Coverage Δ Complexity Δ
...dgs/hdf5j/internal/address/FileAddressManager.java 100% <100%> (ø) 14 <14> (?)
...s/hdf5j/utils/exceptions/FileAddressException.java 55.55% <100%> (ø) 3 <1> (ø) ⬇️
...ava/org/magicdgs/hdf5j/fileformat/FileAddress.java 72.72% <72.72%> (ø) 9 <9> (?)
...gicdgs/hdf5j/internal/address/FileAddressImpl.java 90.9% <90.9%> (ø) 24 <24> (?)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ad4fc1b...3883874. Read the comment docs.

Copy link
Owner Author

@magicDGS magicDGS left a 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
Copy link
Owner Author

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.

Copy link
Owner Author

@magicDGS magicDGS Oct 25, 2017

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.
*
*
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove extra empty line

Copy link
Owner Author

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
Copy link
Owner Author

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.

Copy link
Owner Author

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
Copy link
Owner Author

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

Copy link
Owner Author

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
Copy link
Owner Author

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();
Copy link
Owner Author

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.

Copy link
Owner Author

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();
Copy link
Owner Author

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.

Copy link
Owner Author

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() {
Copy link
Owner Author

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.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

Repository owner deleted a comment Oct 11, 2017
Repository owner deleted a comment Oct 11, 2017
Repository owner deleted a comment Oct 25, 2017
Repository owner deleted a comment Oct 25, 2017
Repository owner deleted a comment Oct 25, 2017
Repository owner deleted a comment Oct 25, 2017
Repository owner deleted a comment Oct 25, 2017
Repository owner deleted a comment Oct 25, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants