commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ebo...@apache.org
Subject svn commit: r1545578 - /commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/common/RationalNumber.java
Date Tue, 26 Nov 2013 09:33:09 GMT
Author: ebourg
Date: Tue Nov 26 09:33:09 2013
New Revision: 1545578

URL: http://svn.apache.org/r1545578
Log:
Made RationalNumber.factoryMethod package private

Modified:
    commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/common/RationalNumber.java

Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/common/RationalNumber.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/common/RationalNumber.java?rev=1545578&r1=1545577&r2=1545578&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/common/RationalNumber.java
(original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/common/RationalNumber.java
Tue Nov 26 09:33:09 2013
@@ -36,7 +36,7 @@ public class RationalNumber extends Numb
         this.divisor = divisor;
     }
 
-    public static RationalNumber factoryMethod(long n, long d) {
+    static RationalNumber factoryMethod(long n, long d) {
         // safer than constructor - handles values outside min/max range.
         // also does some simple finding of common denominators.
 
@@ -67,7 +67,6 @@ public class RationalNumber extends Numb
      * Return the greatest common divisor
      */
     private static long gcd(final long a, final long b) {
-
         if (b == 0) {
             return a;
         } else {
@@ -99,10 +98,6 @@ public class RationalNumber extends Numb
         return (long) numerator / (long) divisor;
     }
 
-    public boolean isValid() {
-        return divisor != 0;
-    }
-
     @Override
     public String toString() {
         if (divisor == 0) {
@@ -135,10 +130,8 @@ public class RationalNumber extends Numb
             this.error = error;
         }
 
-        public static Option factory(final RationalNumber rationalNumber,
-                final double value) {
-            return new Option(rationalNumber, Math.abs(rationalNumber
-                    .doubleValue() - value));
+        public static Option factory(final RationalNumber rationalNumber, final double value)
{
+            return new Option(rationalNumber, Math.abs(rationalNumber .doubleValue() - value));
         }
 
         @Override
@@ -147,9 +140,9 @@ public class RationalNumber extends Numb
         }
     }
 
-    //
-    // calculate rational number using successive approximations.
-    //
+    /**
+     * Calculate rational number using successive approximations.
+     */
     public static RationalNumber valueOf(double value) {
         if (value >= Integer.MAX_VALUE) {
             return new RationalNumber(Integer.MAX_VALUE, 1);



Mime
View raw message