Scala 2.5.0-final

API Specification

This document is the API specification for Scala Library Documentation

Class Summary
class Fluid [T](init : T) extends AnyRef

Fluids provide a binding mechanism where the current value is found through dynamic scope, but where access to the fluid itself is resolved through static binding to a variable referencing the fluid.

The current value can be retrieved with the value method. New values can be pushed using the withValue method. Values pushed via withValue only stay valid while the withValue's second argument, a parameterless closure, executes. When the second argument finishes, the fluid reverts to the previous value.

Usage of withValue looks like this:

  someFluid.withValue(newValue) {
    // ... code called in here that calls value ...
    // ... will be given back the newValue ...

Each thread gets its own stack of bindings. When a new thread is created, the fluid gets a copy of the stack of bindings from the parent thread, and from then on the bindings for the new thread are independent of those for the original thread.

class RichSorting [K <: Ordered[K]](s : Seq[K]) extends AnyRef

A RichSorting object is generally created implicitly through the use of the sort function on an arbitrary sequence, where the items are ordered.

Object Summary
object Properties extends AnyRef
A utility to load the library properties from a Java properties file included in the jar.
object Sorting extends AnyRef

The Sorting object provides functions that can sort various kinds of objects. You can provide a comparison function, or you can request a sort of items that are viewable as Ordered. Some sorts that operate directly on a subset of value types are also provided. These implementations are derived from those in the Sun JDK.

Note that stability doesn't matter for value types, so use the quickSort variants for those. stableSort is intended to be used with objects when the prior ordering should be preserved, where possible.