org.openmali.number
Class PrimeFactorization

java.lang.Object
  extended by org.openmali.number.PrimeFactorization

public class PrimeFactorization
extends java.lang.Object


Constructor Summary
PrimeFactorization()
           
 
Method Summary
static java.util.List<java.lang.Integer> getPrimeFactorization(int integer, java.util.List<java.lang.Integer> passback)
          returns the prime factors for the argument.
static boolean isPrime(int number)
           
static void main(java.lang.String[] args)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PrimeFactorization

public PrimeFactorization()
Method Detail

getPrimeFactorization

public static java.util.List<java.lang.Integer> getPrimeFactorization(int integer,
                                                                      java.util.List<java.lang.Integer> passback)
returns the prime factors for the argument. The resultant list is in order, smallest primes first. passback should be emptied before calling this method e.g. factorization of 12 is 2*2*3 e.g. factorization of 1 is 1 (special case, one not normally returned)


isPrime

public static boolean isPrime(int number)

main

public static void main(java.lang.String[] args)