Package org.jmxtrans.agent.util
Class GcdCalculator
java.lang.Object
org.jmxtrans.agent.util.GcdCalculator
public class GcdCalculator
extends java.lang.Object
- Author:
- Kristoffer Erlandsson
-
Constructor Summary
Constructors Constructor Description GcdCalculator() -
Method Summary
Modifier and Type Method Description static longgcd(java.util.List<java.lang.Long> l)Finds the greatest common divisor of all numbers in the list.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
GcdCalculator
public GcdCalculator()
-
-
Method Details
-
gcd
public static long gcd(java.util.List<java.lang.Long> l)Finds the greatest common divisor of all numbers in the list.- Returns:
- the GCD or Long.MAX_VALUE if the list is empty.
-