in scala
trait Option

trait Option[+A]()
extends Iterable[A]
with ScalaObject
Implementing classes or objects:
class Some[+A1](x: A1)
object None

This class represents optional values. Instances of Option are either instances of case class Some or it is case object None.
Author:
Martin Odersky, Matthias Zenger
Version:
1.0, 16/07/2003

Method Summary
  def elements: Iterator[A]
     Creates a new iterator over all elements contained in this object.
  def filter(p: (A) => Boolean): Option[A]
  def flatMap[B](f: (A) => Option[B]): Option[B]
override def foreach(f: (A) => Unit): Unit
     Apply a function f to all elements of this iterable object.
  def get: A
  def get[B >: A](default: B): B
  def isEmpty: Boolean
  def map[B](f: (A) => B): Option[B]
  def toList: List[A]

Methods inherited from java/lang/Object-class
clone, eq, equals, finalize, getClass, hashCode, ne, notify, notifyAll, synchronized, toString, wait, wait, wait

Methods inherited from scala/Any-class
!=, ==, asInstanceOf, isInstanceOf, match

Methods inherited from scala/Iterable-class
/:, :\, concat, exists, find, foldLeft, foldRight, forall, sameElements

Methods inherited from scala/ScalaObject-class
getScalaType

Method Detail

isEmpty

  def isEmpty: Boolean

get

  def get: A

get

  def get[B >: A](default: B): B

map

  def map[B](f: (A) => B): Option[B]

flatMap

  def flatMap[B](f: (A) => Option[B]): Option[B]

filter

  def filter(p: (A) => Boolean): Option[A]

foreach

  override def foreach(f: (A) => Unit): Unit
Apply a function f to all elements of this iterable object.
Parameters:
f - a function that is applied to every element.

elements

  def elements: Iterator[A]
Creates a new iterator over all elements contained in this object.
Returns:
the new iterator

toList

  def toList: List[A]