| OVERVIEW | PACKAGE | CONSTR | FIELDS | METHODS | FRAMES NO FRAMES | INHERITED |
sealed abstract class Option[+ A]
extends
Product
Option
are either instances of case class Some or it is case
object None.
- Matthias Zenger - Martin Odersky - 1.1, 16/01/2007
def this
|
| elements |
def elements
An singleton iterator returning the option's value if it is nonempty
or the empty iterator if the option is empty
|
Iterator[A] | |
| get |
abstract def get
get the value of this option
[details]
@requires that the option is nonEmpty.
|
A | |
| isDefined |
def isDefined
|
Boolean | |
| isEmpty |
abstract def isEmpty
True if the option is the
None value, false otherwise
|
Boolean | |
| productArity |
abstract def productArity
return k for a product
A(x_1,
[details]
|
Int | Product |
| productPrefix |
def productPrefix
By default the empty string
[details]
Implementations may override this
method in order to prepend a string prefix to the result of the
toString methods.
|
String | Product |
| toList |
def toList
A singleton list containing the option's value if it is nonempty
or the empty list if the option is empty
|
List[A] |
| != |
final def !=(arg0 : Any)
|
Boolean | Any |
| != |
final def !=(arg0 : Object)
|
Boolean | AnyRef |
| == |
final def ==(arg0 : Object)
|
Boolean | AnyRef |
| == |
final def ==(arg0 : Any)
|
Boolean | Any |
| asInstanceOf |
final def asInstanceOf[T0]
|
T0 | Any |
| clone |
protected def clone
|
Object | AnyRef |
| eq |
final def eq(arg0 : Object)
|
Boolean | AnyRef |
| equals |
def equals(arg0 : Any)
|
Boolean | AnyRef |
| filter |
def filter(p : (A) => Boolean)
If the option is nonempty and the given predicate
p
yields false on its value, return None
[details]
Otherwise return the option value itself.
|
Option[A] | |
| finalize |
protected def finalize
|
Unit | AnyRef |
| flatMap |
def flatMap[B](f : (A) => Option[B])
If the option is nonempty, return a function applied to its value
[details]
Otherwise return None.
|
Option[B] | |
| foreach |
def foreach(f : (A) => Unit)
Apply the given procedure
f to the option's value,
if it is nonempty
[details]
Do nothing if it is empty.
|
Unit | |
| get |
def get[B >: A](default : B)
[details]
|
B | |
| getClass |
final def getClass
|
Class[Any] | AnyRef |
| getOrElse |
def getOrElse[B >: A](default : => B)
If the option is nonempty return its value,
otherwise return the result of evaluating a default expression
[details]
|
B | |
| hashCode |
def hashCode
|
Int | AnyRef |
| isInstanceOf |
final def isInstanceOf[T0]
|
Boolean | Any |
| map |
def map[B](f : (A) => B)
If the option is nonempty, return a function applied to its value,
wrapped in a Some i
[details]
e.
Some(f(this.get)).
Otherwise return None.
|
Option[B] | |
| ne |
final def ne(arg0 : Object)
|
Boolean | AnyRef |
| notify |
final def notify
|
Unit | AnyRef |
| notifyAll |
final def notifyAll
|
Unit | AnyRef |
| orElse |
def orElse[B >: A](alternative : => Option[B])
If the option is nonempty return it,
otherwise return the result of evaluating an alternative expression
[details]
|
Option[B] | |
| productElement |
abstract def productElement(n : Int)
for a product
A(x_1,
[details]
|
Any | Product |
| synchronized |
final def synchronized[T0](arg0 : T0)
|
T0 | AnyRef |
| toLeft |
def toLeft[X](right : => X)
An
Either that is a Right with the given argument
right if this is empty, or a Left if this is nonempty with the
option's value
|
Either[A, X] with Product |
|
| toRight |
def toRight[X](left : => X)
An
Either that is a Left with the given argument
left if this is empty, or a Right if this is nonempty with the
option's value
|
Either[X, A] with Product |
|
| toString |
def toString
|
String | AnyRef |
| wait |
final def wait
|
Unit | AnyRef |
| wait |
final def wait(arg0 : Long)
|
Unit | AnyRef |
| wait |
final def wait(arg0 : Long, arg1 : Int)
|
Unit | AnyRef |
| OVERVIEW | PACKAGE | CONSTR | FIELDS | METHODS | FRAMES NO FRAMES | INHERITED |