Skip to content

Commit

Permalink
[API CHANGE] MathTools only used in a single package in structgen, mo…
Browse files Browse the repository at this point in the history
…ve it there and make non-public.
  • Loading branch information
johnmay committed Feb 12, 2017
1 parent 9a9355b commit 93f9b07
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*/
package org.openscience.cdk.math;
package org.openscience.cdk.structgen;


/**
Expand All @@ -25,15 +25,15 @@
* @cdk.module standard
* @cdk.githash
*/
public class MathTools {
class MathTools {

/**
* Analog of Math.max that returns the largest double value in an array of doubles.
*
* @param values the values to be searched for the largest value among them
* @return the largest value among a set of given values
*/
public static double max(double[] values) {
static double max(double[] values) {
double max = values[0];
for (double value : values)
if (value > max) max = value;
Expand All @@ -46,7 +46,7 @@ public static double max(double[] values) {
* @param values the values to be searched for the smallest value among them
* @return the smallest value among a set of given values
*/
public static double min(double[] values) {
static double min(double[] values) {
double min = values[0];
for (double value : values)
if (value < min) min = value;
Expand All @@ -56,7 +56,7 @@ public static double min(double[] values) {
/**
* Analog of Math.max that returns the largest int value in an array of ints.
**/
public static int max(int[] values) {
static int max(int[] values) {
int max = values[0];
for (int value : values) {
if (value > max) {
Expand All @@ -69,7 +69,7 @@ public static int max(int[] values) {
/**
* Analog of Math.max that returns the largest int value in an array of ints.
**/
public static int min(int[] values) {
static int min(int[] values) {
int min = values[0];
for (int value : values) {
if (value < min) {
Expand All @@ -79,11 +79,11 @@ public static int min(int[] values) {
return min;
}

public static boolean isOdd(int intValue) {
static boolean isOdd(int intValue) {
return !MathTools.isEven(intValue);
}

public static boolean isEven(int intValue) {
static boolean isEven(int intValue) {
return intValue % 2 == 0;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
import org.openscience.cdk.interfaces.IAtom;
import org.openscience.cdk.interfaces.IAtomContainer;
import org.openscience.cdk.interfaces.IBond;
import org.openscience.cdk.math.MathTools;
import org.openscience.cdk.tools.ILoggingTool;
import org.openscience.cdk.tools.LoggingToolFactory;
import org.openscience.cdk.tools.manipulator.BondManipulator;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
import org.openscience.cdk.interfaces.IAtom;
import org.openscience.cdk.interfaces.IAtomContainer;
import org.openscience.cdk.interfaces.IBond;
import org.openscience.cdk.math.MathTools;
import org.openscience.cdk.tools.ILoggingTool;
import org.openscience.cdk.tools.LoggingToolFactory;
import org.openscience.cdk.tools.manipulator.BondManipulator;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,10 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
*/
package org.openscience.cdk.math;
package org.openscience.cdk.structgen;

import org.junit.Assert;
import org.junit.Test;
import org.openscience.cdk.math.MathTools;
import org.openscience.cdk.CDKTestCase;

/**
Expand Down

0 comments on commit 93f9b07

Please sign in to comment.