Scaladoc: uncarved-helpers

This document is the API specification for uncarved-helpers

Class Summary
trait CanLog extends AnyRef
CanLog is a trait you can mix in to provide easy log4j logging for your scala classes. Sample usage:
     class MyClass extends CanLog {
         def doSomething(temp: Int) = {
             logger.debug("About to doSomething")
             if(temp>100) 
                 logger.warn("It's mighty hot! temp: " + temp)
             
             logger.debug("Done with doSomething")
         }
     }
 
class HashHelper (seedOpt : scala.Option[Int], primeOpt : scala.Option[Int]) extends AnyRef
Helper class for defining hashCode
Object Summary
object Memoize extends AnyRef
Factory object for producing generalized memoized functions of up to four arguments. Usage:
  val circArea = 
      Memoize((r:Double)=>Math.Pi * Math.pow(r,2))

  val area = circArea(2)

  val cylVol = Memoize {
      (r:Double, h:Double) => 
        val vol = Math.Pi * Math.pow(r,2) * h
        println("Radius: " + r + " Height: " + 
            h + " Volume: " + vol)
        vol
  }

  val vol = cylVol(2, 3.5)
  val twoRCyl = cylVol.curry(2) //We can partially apply as normal
  val vol2 = twoRCyl(3.5)       //...and the memoization cache is shared

  def sphereVol(r: Double) = Math.Pi * Math.pow(r,3)

  val memoSV = Memoize(sphereVol _)