Skip to content

Commit

Permalink
Correct javadoc for SpecificTesterClasses
Browse files Browse the repository at this point in the history
Partially, to be continued
  • Loading branch information
m-vokhm committed Feb 28, 2021
1 parent c8f50a9 commit 068dabf
Show file tree
Hide file tree
Showing 64 changed files with 817 additions and 823 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ in standard notation. Some special notations, such as "Quadruple.NaN", are also
operations even with different instances of the class.

For more details, see the
[Quadruple class documentation](doc/index.html)
[Quadruple class documentation](https://m-vokhm.github.io/Quadruple/doc/index.html)

#### Motivation
The main goal of the project was to provide the ability to perform calculations
Expand Down Expand Up @@ -71,7 +71,7 @@ intended to be used with `JUnit`, are in the `QuadJUnitTests.java` class.
They use the same data as the aforementioned standalone utility.

For more details, see the
[Quadruple tests documentation](test/doc/index.html)
[Quadruple tests documentation](https://m-vokhm.github.io/Quadruple/test/doc/index.html)



4 changes: 2 additions & 2 deletions test/com/mvohm/quadruple/test/AuxMethods.java
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ public static String hexStr(long lValue) {
* Returns a hexadecimal string representation of the given double value,
* that separately shows its sign, mantissa, and exponent, e.g.
* <span class="nowrap">"-6_a09e_667f_3bcd e 3ff"</span>
* @param dValue -- the value to convert to hexadecimal string
* @param dValue the value to convert to hexadecimal string
* @return the hexadecimal string representation of the given double value
*/
public static String hexStr(double dValue) {
Expand Down Expand Up @@ -773,7 +773,7 @@ public static BigDecimal sqrt(final BigDecimal arg) {
/**
* Calculates {@code 2^exp} with the accuracy of 140 decimal digits.
*
* @param exp -- the power to raise 2 to
* @param exp the power to raise 2 to
* @return the value of two raised to the given power
*/
public static BigDecimal powerOfTwo(int exp) {
Expand Down
5 changes: 5 additions & 0 deletions test/com/mvohm/quadruple/test/Consts.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@
*/
public class Consts {

/** Acceptable relative error threshold for all operations, a little greater
* than half of the least significant bit of the mantissa.<br>
* More exactly, (2^-129) * 1.0005 == ~1.4693679e-39 * 1.0005 == 1.4701e-39 */
static final double NORM_ERR_THRESH = 1.470e-39; // 2^-129 * 1.0005

// started JavaDoc 21.02.19 10:43:13
/** The bits of the mantissa of a {@code double}'s bits represented as a {@code long} */
public static final long DOUBLE_MANT_MASK = 0x000f_ffff_ffff_ffffL;
Expand Down
30 changes: 15 additions & 15 deletions test/com/mvohm/quadruple/test/DataGenerators.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public class DataGenerators {
/**
* Takes a list where each item contains a value and insert nulls in even positions,
* so that the result looks like v1, null, v2, null, etc. The input list remains unchanged.
* @param inpList -- a dense list with values
* @param inpList a dense list with values
* @return a list where the values from the input list are supplemented with null items
*/
public static List<String> insertNulls(List<String> inpList) {
Expand All @@ -60,8 +60,8 @@ public static List<String> insertNulls(List<String> inpList) {

/**
* Adds the given strings to the end of the list
* @param list -- the list to add the comments to
* @param comments -- the comment lines to add to the list
* @param list the list to add the comments to
* @param comments the comment lines to add to the list
* @return the input list with the given strings added to the end of it
*/
public static List<String> addComment(List<String> list, String...comments) {
Expand Down Expand Up @@ -299,8 +299,8 @@ public static List<String> multiplyByFactors(List<String> inputList, double... f
* which is performed by {@code String} to {@code Quadruple} and {@code String} to {@code Quadruple} conversions.
* @param mantissas a number of mantissas to form the base values for the subsequences
* @param addition a constant to be added to the mantissa to form the base value of the subsequence
* @param maxDelta -- maximum magnitude of the delta to be added or subtracted to the base value before multiplying it by MIN_VALUE;
* @param minDelta -- minimum magnitude of the delta to be added or subtracted to the base value before multiplying it by MIN_VALUE;
* @param maxDelta maximum magnitude of the delta to be added or subtracted to the base value before multiplying it by MIN_VALUE;
* @param minDelta minimum magnitude of the delta to be added or subtracted to the base value before multiplying it by MIN_VALUE;
* @return a list of strings expressing the values described
*/
public static List<String> subnormalVicinities(String[] mantissas, double addition, double maxDelta, double minDelta) {
Expand Down Expand Up @@ -489,9 +489,9 @@ private static List<String> cartesianSquareWithMinusZeros(String[] operands, Bin

/**
* Checks whether the given operation applied to the given operands results in -0
* @param op1str -- 1st operand as a String
* @param op2str -- 2nd operand as a String
* @param operation -- the operation to perform on the operands
* @param op1str 1st operand as a String
* @param op2str 2nd operand as a String
* @param operation the operation to perform on the operands
* @return true, if the result of the operation is -0, false otherwise
*/
private static boolean isMinusZero(String op1str, String op2str, BinaryOperator<Double> operation) {
Expand Down Expand Up @@ -607,7 +607,7 @@ public static List<String> randLongs(int count) {
* Returns a list of pairs of random values, with null after each pair.
* The values of the items in each pair are concerted so that their addition makes sense in most cases
* (i.e. the expected result does not equal to one of the operands and is not Infinity)
* @param count -- the number of pairs to generate
* @param count the number of pairs to generate
* @return a list of strings, containing string representations of the generated pairs of values,
* with nulls inserted after each pair
*/
Expand All @@ -619,7 +619,7 @@ public static List<String> randomsForAddition(int count) {
* Returns a list of pairs of random values, with null after each pair.
* The values of the items in each pair are concerted so that their multiplication makes sense in most cases
* (i.e. the expected result is rarely equal to 0 or Infinity).
* @param count -- the number of pairs to generate
* @param count the number of pairs to generate
* @return a list of strings, containing string representations of the generated pairs of values,
* with nulls inserted after each pair
*/
Expand All @@ -631,7 +631,7 @@ public static List<String> randomsForMultiplication(int count) {
* Returns a list of pairs of random values, with null after each pair.
* The values of the items in each pair are concerted so that division makes sense in most cases
* (i.e. the expected result is rarely equal to 0 or Infinity)
* @param count -- the number of pairs to generate
* @param count the number of pairs to generate
* @return a list of strings, containing string representations of the generated pairs of values,
* with nulls inserted after each pair
*/
Expand Down Expand Up @@ -788,7 +788,7 @@ private static int randomDoubleExponent() {
* A function to get a random exponent of the the second value of a pair
* based on the exponent of the first value such that multiplication of the two values
* make sense in most cases
* @param exp -- the exponent of the first value of the pair
* @param exp the exponent of the first value of the pair
* @return the generated value of the exponent for the second value of the pair
*/
private static int otherExpForMult(int exp) {
Expand All @@ -801,7 +801,7 @@ private static int otherExpForMult(int exp) {
* A function to get a random exponent of the the second value of a pair
* based on the exponent of the first value such that division of the first value
* by the second would make sense in most cases
* @param exp -- the exponent of the first value of the pair
* @param exp the exponent of the first value of the pair
* @return the generated value of the exponent for the second value of the pair
*/
private static int otherExpForDiv(int exp) {
Expand Down Expand Up @@ -1119,8 +1119,8 @@ private static List<Integer> allExponents() {

/** Returns a string representation of the value represented by the {@code value} parameter
* multiplied by two raised to power {@code exp}: {@code value * 2^exp}
* @param value -- the value to multiply by the power of two
* @param exp -- the power to raise two to to get the factor
* @param value the value to multiply by the power of two
* @param exp the power to raise two to to get the factor
* @return a string representation of the resulting value
*/
private static String multByPowerOfTwo(String value, int exp) {
Expand Down
22 changes: 11 additions & 11 deletions test/com/mvohm/quadruple/test/DataItem.java
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ public DataItem(String role) {
* To be usable for DataItems with expected values, distinguish word "error" as an indication of the fact
* that the operation being tested, when applied to the given input data, was expected to cause an error
* (like for a priori illegal source strings when testing String to Quadruple conversion)
* @param strValue -- the {@code String} that's expected to signify the numeric value to be assigned
* @param strValue the {@code String} that's expected to signify the numeric value to be assigned
* @return this instance with the fields modified as described above
* @see DataItem#withValueOfString(String)
*/
Expand All @@ -134,7 +134,7 @@ public DataItem withQuadValueOfString(String strValue) {
* {@code strValue} field. If the parameter is a {@code String} and it can't be parsed as a numeric value,
* the {@code quadValue} and {@code bdValue} remains empty and the {@code errMsg} field is assigned with
* a relevant error message. In this case, {@code strValue} field takes the value of the input string
* @param rawData -- the data whose value is to be assigned
* @param rawData the data whose value is to be assigned
* @return this instance with the fields modified as described above
*/
public DataItem withValueOf(Object rawData) {
Expand All @@ -150,7 +150,7 @@ public DataItem withValueOf(Object rawData) {
/** Assigns the given value, that may be of any type, to the {@code rawData} field of the instance.
* Used to hold and display source values of various types that are to be converted to
* {@code Quadruple} and results of converting {@code Quadruple} values to various other types.
* @param rawData -- the value to assign
* @param rawData the value to assign
* @return the same instance with the given value assigned to the {@code rawData} field
*/
public DataItem withRawValue(Object rawData) {
Expand All @@ -162,7 +162,7 @@ public DataItem withRawValue(Object rawData) {
* Assigns the given value to the {@code quadValue} field; if the value may be represented as a {@code BigDecimal},
* additionally assigns the corresponding {@code BigDecimal} value to the {@code bdValue} field, otherwise (in case of NaN or Infinity)
* sets a {@code String} string representation of the given value in the {@code strValue} field.
* @param value -- the {@code Quadruple} whose value is to be assigned to the fields of the instance
* @param value the {@code Quadruple} whose value is to be assigned to the fields of the instance
* @return this instance with the fields modified as described above
*/
public DataItem withQuadruple(Quadruple value) {
Expand Down Expand Up @@ -196,7 +196,7 @@ public DataItem withQuadruple(Quadruple value) {
* To be usable for DataItems with expected values, distinguish word "error" as an indication of the fact
* that the operation being tested, when applied to the given input data, was expected to cause an error
* (like for a priori illegal source strings when testing String to Quadruple conversion)
* @param strValue -- the {@code String} that's expected to signify the numeric value to be assigned
* @param strValue the {@code String} that's expected to signify the numeric value to be assigned
* @return this instance with the fields modified as described above
* @see DataItem#withQuadValueOfString(String)
*/
Expand Down Expand Up @@ -241,7 +241,7 @@ public DataItem withValueOfString(String strValue) {
} // public DataItem withValueOfString(String strValue) {

/** Sets the given error message, after prepending it with "Error: ", in the {@code errMsg} field.
* @param errMsg -- the message to set
* @param errMsg the message to set
* @return this instance with the {@code errMsg} field containing the error message
*/
public DataItem withError(String errMsg) {
Expand All @@ -251,8 +251,8 @@ public DataItem withError(String errMsg) {

/** Sets the given error message, after prepending it with "Error: ", in the {@code errMsg} field.
* Additionally, sets the value of the {@code sourceStr} parameter in the {@code strValue} field
* @param errMsg -- the message to set in the {@code errMsg} field
* @param sourceStr -- the string to set in the {@code strValue} field
* @param errMsg the message to set in the {@code errMsg} field
* @param sourceStr the string to set in the {@code strValue} field
* @return this instance with the {@code errMsg} field containing the error message
* and the {@code strValue} field containing the value of the {@code sourceStr} parameter
*/
Expand Down Expand Up @@ -362,7 +362,7 @@ else if (rawData != null) {
* Parses an input string expected to represent a {@code Quadruple} value. In case of error
* sets the appropriate error message in the the {@code errMsg} field and the puts the input string
* in the {@code strValue} field.
* @param strValue -- a string expected to represent a Quadruple value
* @param strValue a string expected to represent a Quadruple value
* @return a new {@code Quadruple} instance with the value obtained from the string, or null in case of error
*/
private Quadruple parseQuadruple(String strValue) {
Expand Down Expand Up @@ -393,7 +393,7 @@ private Quadruple parseQuadruple(String strValue) {
/**
* Sets the input value in the {@code bdValue} field, and finds and sets in the {@code quadValue} field
* the nearest possible approximation of that value.
* @param bdValue -- the value to set
* @param bdValue the value to set
* @return this instance with the fields modified as described above
*/
private DataItem setBDValue(BigDecimal bdValue) { // 19.11.15 17:24:47
Expand All @@ -410,7 +410,7 @@ else if (bdValue.compareTo(MAX_VALUE_THRESHOLD.negate()) <= 0)

/**
* Sets the fields of the instance so that they represent the exact value of the input value
* @param d -- the value to set
* @param d the value to set
* @return this instance with the fields modified as described above
*/
private DataItem setDoubleValue(Double d) {
Expand Down
Loading

0 comments on commit 068dabf

Please sign in to comment.