Package

io.radanalytics.silex

util

Permalink

package util

Visibility
  1. Public
  2. All

Type Members

  1. case class DateTimeUTC(year: Int, month: Int, day: Int, hour: Int, minute: Int, second: Int, millis: Int = 0) extends Product with Serializable

    Permalink

    A simple structure representing a calendar date in UTC.

    A simple structure representing a calendar date in UTC.

    This class is deliberately extremely simple and delegates out to joda-time for its actual functionality; it exists solely to abstract away our choice of date and time library. (In JDK 8, it would probably make sense to use the new standard library date and time classes.)

    If you need to deal with multiple time zones or different calendars, you're probably best served by using something more sophisticated (although the from method in the companion object to convert from a org.joda.time.DateTime will convert to UTC first).

  2. trait Logging extends AnyRef

    Permalink
  3. final class OptionalArg[A] extends AnyVal

    Permalink

    Provides idiomatic optional parameter values on top of Option, but which can be passed in as raw values, instead of having to pass in Some(value)

    Provides idiomatic optional parameter values on top of Option, but which can be passed in as raw values, instead of having to pass in Some(value)

    import io.radanalytics.silex.util.OptionalArg
    
    def possiblyFilter(data: Seq[Int], filterMax: OptionalArg[Int] = None) = {
      // Treat an OptionalArg like an Option, for idiomatic handling of unset vals as None
      if (filterMax.isEmpty) data else data.filter(_ <= filterMax.get)
    }
    
    val data = Seq(1, -1, 2)
    
    // default filterMax is None
    possiblyFilter(data) // returns data unfiltered
    
    // provide argument as (-1), instead of having to specify Some(-1)
    possiblyFilter(data, filterMax = -1) // returns Seq(-1)
    
    // Support full Option methods and implicit conversion to Option
    import OptionalArg.fullOptionSupport
    def possiblyFilterUsingMap(data: Seq[Int], filterMax: OptionalArg[Int] = None) = {
      // use the 'map' method on an OptionalArg:
      filterMax.map(t => data.filter(_ <= t)).getOrElse(data)
    }
    A

    The underlying value type.

  4. sealed class SampleSink extends Serializable

    Permalink

    On-line mean and variance estimates for a stream of Double values.

    On-line mean and variance estimates for a stream of Double values. Uses Chan's formulae.

  5. trait TimeLens extends AnyRef

    Permalink

    A function object to convert to and from times in some particular string format

Value Members

  1. object AWSTimeLens extends TimeLens

    Permalink

    A function object to convert to and from times in the AWS billing format.

    A function object to convert to and from times in the AWS billing format.

    These are UTC, in the form YYYY-MM-DD HH:MM:SS. By converting to the DateTimeUTC format, you can manipulate individual components or convert to another format for further processing.

  2. object Amortizer

    Permalink
  3. object DateTimeUTC extends Serializable

    Permalink
  4. object DirUtils

    Permalink
  5. object OptionalArg

    Permalink

    Factory methods and implicit conversions from raw values and Option to OptionalArg

  6. object ProductToCSV

    Permalink
  7. object RegexImplicits

    Permalink
  8. object SampleSink extends Serializable

    Permalink
  9. object TimeUtils

    Permalink
  10. package VectorID

    Permalink
  11. object richslice

    Permalink

  12. package vectors

    Permalink

Ungrouped