| OVERVIEW | PACKAGE | CONSTR | FIELDS | METHODS | FRAMES NO FRAMES | INHERITED |
sealed abstract class Box[+ A]
extends
Product
Full(1).run("zero") { (x: String, y: Int) => y.toString }Full(1) $ { x: Box[Int] => println(x openOr 0) }
def this
|
| elements.. |
def elements
Returns an Iterator over the value contained in this Box
|
Iterator[A] | |
| isDefined.. |
def isDefined
Returns true if the box contains a value
[details]
|
Boolean | |
| isEmpty.. |
abstract def isEmpty
Returns true if this Box contains no value (is Empty or Failure)
[details]
|
Boolean | |
| iterator.. |
def iterator
Returns an Iterator over the value contained in this Box
|
Iterator[A] | |
| open_!.. |
abstract def open_!
Return the value contained in this Box if it is full; throw an exception otherwise
[details]
|
A | |
| productArity.. |
abstract def productArity
|
Int | Product |
| productPrefix.. |
def productPrefix
|
String | Product |
| toList.. |
def toList
Returns a List of one element if this is Full, or an empty list if Empty
|
List[A] | |
| toOption.. |
def toOption
Returns the contents of this box in an Option if this is Full, or
None if this is a failure or Empty
|
Option[A] |
| !=.. |
final def !=(arg0 : Object)
|
Boolean | AnyRef |
| !=.. |
final def !=(arg0 : Any)
|
Boolean | Any |
| ==.. |
final def ==(arg0 : Any)
|
Boolean | Any |
| ==.. |
final def ==(arg0 : Object)
|
Boolean | AnyRef |
| ===.. |
def ===[B >: A](to : B)
Returns true if the value contained in this box is equal to the specified value
|
Boolean | |
| ?~.. |
def ?~(msg : String)
Transform an Empty to a Failure with the specified message
[details]
|
Box[A] | |
| ?~!.. |
def ?~!(msg : String)
Transform an Empty to a Failure with the specified message and chain
the new Failure to any previous Failure represented by this Box
[details]
|
Box[A] | |
| asA.. |
def asA[B](implicit m : Manifest[B])
Return a Full[B] if the contents of this Box is of type
B, otherwise return Empty
|
Box[B] | |
| asInstanceOf.. |
final def asInstanceOf[T0]
|
T0 | Any |
| choice.. |
def choice[B](f1 : (A) => Box[B])(alternative : => Box[B])
Apply the function f1 to the contents of this Box if available; if this
is Empty return the specified alternative
|
Box[B] | |
| clone.. |
protected def clone
|
Object | AnyRef |
| collect.. |
abstract def collect[B](pf : PartialFunction[A, B])
If the partial function is defined at the current Box's value
apply the partial function
|
Box[B] | |
| compoundFailMsg.. |
def compoundFailMsg(msg : String)
Alias for ?~!
|
Box[A] | |
| dmap.. |
def dmap[B](dflt : => B)(f : (A) => B)
Equivalent to map(f)
[details]
or(Full(dflt)).open_!
|
B | |
| eq.. |
final def eq(arg0 : Object)
|
Boolean | AnyRef |
| equals.. |
override def equals(other : Any)
Determines equality based upon the contents of this Box instead of the box itself
[details]
For Full and Empty, this has the expected behavior. Equality in terms of Failure
checks for equivalence of failure causes.
|
Boolean | |
| exists.. |
def exists(func : (A) => Boolean)
Determine whether this Box contains a value which satisfies the specified predicate
[details]
|
Boolean | |
| failMsg.. |
def failMsg(msg : String)
Alias for ?~
|
Box[A] | |
| filter.. |
def filter(p : (A) => Boolean)
Return this Box if it contains a value satisfying the specified predicate; Empty otherwise
[details]
|
Box[A] | |
| filterMsg.. |
def filterMsg(msg : String)(p : (A) => Boolean)
Filter this box on the specified predicate, returning a Failure with the specified
message if the predicate is not satisfied
[details]
|
Box[A] | |
| finalize.. |
protected def finalize
|
Unit | AnyRef |
| flatMap.. |
def flatMap[B](f : (A) => Box[B])
Apply a function returning a Box to the value contained in this Box if it exists
and return the result, or Empty otherwise
[details]
|
Box[B] | |
| foreach.. |
def foreach[U](f : (A) => U)
Perform a side effect by calling the specified function
with the value contained in this box
|
Unit | |
| getClass.. |
final def getClass
|
Class[Any] | AnyRef |
| hashCode.. |
def hashCode
|
Int | AnyRef |
| isA.. |
def isA[B](cls : Class[B])
Return a Full[B] if the contents of this Box is an instance of the specified class,
otherwise return Empty
|
Box[B] | |
| isInstanceOf.. |
final def isInstanceOf[T0]
|
Boolean | Any |
| map.. |
def map[B](f : (A) => B)
Apply a function to the value contained in this Box if it exists and return
a new Box containing the result, or Empty otherwise
[details]
|
Box[B] | |
| ne.. |
final def ne(arg0 : Object)
|
Boolean | AnyRef |
| notify.. |
final def notify
|
Unit | AnyRef |
| notifyAll.. |
final def notifyAll
|
Unit | AnyRef |
| openOr.. |
def openOr[B >: A](default : => B)
Return the value contained in this Box if it is full; otherwise return the specified default
[details]
|
B | |
| or.. |
def or[B >: A](alternative : => Box[B])
Return this Box if Full, or the specified alternative if this is Empty
|
Box[B] | |
| pass.. |
def pass(f : (Box[A]) => Unit)
Perform a side effect by passing this Box to the specified function
and return this Box unmodified
[details]
|
Box[A] | |
| productElement.. |
abstract def productElement(arg0 : Int)
|
Any | Product |
| run.. |
def run[T](in : T)(f : (T, A) => T)
This method calls the specified function with the value contained in this Box
[details]
|
T | |
| synchronized.. |
final def synchronized[T0](arg0 : T0)
|
T0 | AnyRef |
| toLeft.. |
def toLeft[B](right : => B)
An
Either that is a Right with the given
argument
right if this is empty, or a Left if this is
Fill with the Box's value
|
Either[A, B] | |
| toRight.. |
def toRight[B](left : => B)
An
Either that is a Left with the given argument
left if this is empty, or a Right if this
Full with the Box's value
|
Either[B, A] | |
| toString.. |
def toString
|
String | AnyRef |
| wait.. |
final def wait(arg0 : Long, arg1 : Int)
|
Unit | AnyRef |
| wait.. |
final def wait
|
Unit | AnyRef |
| wait.. |
final def wait(arg0 : Long)
|
Unit | AnyRef |
| withFilter.. |
def withFilter(p : (A) => Boolean)
Makes Box play better with Scala 2
[details]
8 for comprehensions
|
WithFilter | |
| ~>.. |
def ~>[T](errorCode : T)
Transform an Empty to a ParamFailure with the specified typesafe
parameter
[details]
|
Box[A] |
| OVERVIEW | PACKAGE | CONSTR | FIELDS | METHODS | FRAMES NO FRAMES | INHERITED |