Skip to content
This repository was archived by the owner on Aug 23, 2020. It is now read-only.

document converter #1130

Merged
merged 2 commits into from
Nov 12, 2018
Merged

document converter #1130

merged 2 commits into from
Nov 12, 2018

Conversation

alon-e
Copy link
Contributor

@alon-e alon-e commented Nov 8, 2018

Description

Code comments for the Converter.java class.

Fixes # 1117

Type of change

  • Documentation Fix

I haven't documented the Pair<->Trits methods. I don't see them in use either than testing and frankly didn't follow what each method does.

Issues to open:

  1. method naming is not consistent between inverse functions.
    • " - arguments
  2. pos & offset are used interchangeably

@alon-e alon-e added C-Docs E-Documentation Epic - Documentation of IRI labels Nov 8, 2018
@@ -2,6 +2,21 @@

import java.util.Arrays;

/**
* Converts different between representations of trytes, bytes, trits and numbers.
Copy link
Contributor

Choose a reason for hiding this comment

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

Converts different between -> Converts between different

* <p>
* This class also provides additional conversion tools:
* <ul>
* <li>Converting Trits to numerical values based on <i>Balance Ternary</i> arithmetic</li>
Copy link
Contributor

Choose a reason for hiding this comment

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

Balance Ternary -> Balanced ternary


/**
* Creates a new trits array with the converted tryte string.<br>
* should be used most for testing, as it allocates memory.
Copy link
Contributor

Choose a reason for hiding this comment

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

should be used most for testing, as it allocates memory
->
should be used mainly for testing as it allocates memory.

I would even go as far as: use only for testing as it allocates memory.

// Long <-> Trits

/**
* Parses the trits argument as a long value, based on <i>Balance Ternary</i> arithmetic
Copy link
Contributor

Choose a reason for hiding this comment

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

Balance Ternary -> Balanced ternary

}

/**
* fills a trit array with a representation of the {@code value} argument in <i>Balance Ternary</i> arithmetic
Copy link
Contributor

Choose a reason for hiding this comment

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

Balance Ternary -> Balanced ternary


/**
* Converts trits array to bytes array based on {@link #NUMBER_OF_TRITS_IN_A_BYTE}.<br>
* this method will over-ride the content of {@code dest}
Copy link
Contributor

Choose a reason for hiding this comment

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

over-ride -> override :nerd_face

@alon-e
Copy link
Contributor Author

alon-e commented Nov 9, 2018

btw, @jakubcech - Github just added a cool feature to suggest changes: see the +- symbol (ctrl+g)
this allows the PR author to automatically accept and commit the suggested changes in the PR.
would be great to use these in Docs PRs as the changes are often one-liners.

https://blog.github.com/2018-10-16-future-of-software/#suggested-changes-public-beta

@jakubcech jakubcech merged commit 59dc84e into iotaledger:dev Nov 12, 2018
@GalRogozinski GalRogozinski mentioned this pull request Dec 22, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
C-Docs E-Documentation Epic - Documentation of IRI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants