class SessionVar[+A] extends OptVar[A]
- Alphabetic
- By Inheritance
- SessionVar
- OptVar
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
- new SessionVar()(implicit m: Manifest[A])
Type Members
-
class
WithFilter
extends AnyRef
We need a whole WithFilter class to honor the "doesn't create a new collection" contract even though it seems unlikely to matter much in a collection with max size 1.
We need a whole WithFilter class to honor the "doesn't create a new collection" contract even though it seems unlikely to matter much in a collection with max size 1.
- Definition Classes
- OptVar
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
collect[B](pf: PartialFunction[A, B])(implicit action: Action): Option[B]
Returns a scala.Some containing the result of applying
pfto this scala.Option's contained value, if this option is nonempty andpfis defined for that value.Returns a scala.Some containing the result of applying
pfto this scala.Option's contained value, if this option is nonempty andpfis defined for that value. ReturnsNoneotherwise.- pf
the partial function.
- returns
the result of applying
pfto this scala.Option's value (if possible), orNone.
- Definition Classes
- OptVar
- Annotations
- @inline()
// Returns Some(HTTP) because the partial function covers the case. Some("http") collect {case "http" => "HTTP"} // Returns None because the partial function doesn't cover the case. Some("ftp") collect {case "http" => "HTTP"} // Returns None because None is passed to the collect method. None collect {case value => value}
Example: -
final
def
contains[A1 >: A](elem: A1)(implicit action: Action): Boolean
Tests whether the option contains a given value as an element.
Tests whether the option contains a given value as an element.
- elem
the element to test.
- returns
trueif the option has an element that is equal (as determined by==) toelem,falseotherwise.
- Definition Classes
- OptVar
// Returns true because Some instance contains string "something" which equals "something". Some("something") contains "something" // Returns false because "something" != "anything". Some("something") contains "anything" // Returns false when method called on None. None contains "anything"
Example: -
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
exists(p: (A) ⇒ Boolean)(implicit action: Action): Boolean
Returns true if this option is nonempty and the predicate
preturns true when applied to this scala.Option's value.Returns true if this option is nonempty and the predicate
preturns true when applied to this scala.Option's value. Otherwise, returns false.- p
the predicate to test
- Definition Classes
- OptVar
- Annotations
- @inline()
-
final
def
filter(p: (A) ⇒ Boolean)(implicit action: Action): Option[A]
Returns this scala.Option if it is nonempty and applying the predicate
pto this scala.Option's value returns true.Returns this scala.Option if it is nonempty and applying the predicate
pto this scala.Option's value returns true. Otherwise, returnNone.- p
the predicate used for testing.
- Definition Classes
- OptVar
- Annotations
- @inline()
-
final
def
filterNot(p: (A) ⇒ Boolean)(implicit action: Action): Option[A]
Returns this scala.Option if it is nonempty and applying the predicate
pto this scala.Option's value returns false.Returns this scala.Option if it is nonempty and applying the predicate
pto this scala.Option's value returns false. Otherwise, returnNone.- p
the predicate used for testing.
- Definition Classes
- OptVar
- Annotations
- @inline()
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
flatMap[B](f: (A) ⇒ Option[B])(implicit action: Action): Option[B]
Returns the result of applying
fto this scala.Option's value if this scala.Option is nonempty.Returns the result of applying
fto this scala.Option's value if this scala.Option is nonempty. ReturnsNoneif this scala.Option is empty. Slightly different frommapin thatfis expected to return an scala.Option (which could beNone).- f
the function to apply
- Definition Classes
- OptVar
- Annotations
- @inline()
- See also
foreach
map
-
def
flatten[B](implicit ev: <:<[A, Option[B]], action: Action): Option[B]
- Definition Classes
- OptVar
-
final
def
fold[B](ifEmpty: ⇒ B)(f: (A) ⇒ B)(implicit action: Action): B
Returns the result of applying
fto this scala.Option's value if the scala.Option is nonempty.Returns the result of applying
fto this scala.Option's value if the scala.Option is nonempty. Otherwise, evaluates expressionifEmpty.- ifEmpty
the expression to evaluate if empty.
- f
the function to apply if nonempty.
- Definition Classes
- OptVar
- Annotations
- @inline()
- Note
This is equivalent to
scala.Option map f getOrElse ifEmpty.
-
final
def
forall(p: (A) ⇒ Boolean)(implicit action: Action): Boolean
Returns true if this option is empty or the predicate
preturns true when applied to this scala.Option's value.Returns true if this option is empty or the predicate
preturns true when applied to this scala.Option's value.- p
the predicate to test
- Definition Classes
- OptVar
- Annotations
- @inline()
-
final
def
foreach[U](f: (A) ⇒ U)(implicit action: Action): Unit
Apply the given procedure
fto the option's value, if it is nonempty.Apply the given procedure
fto the option's value, if it is nonempty. Otherwise, do nothing.- f
the procedure to apply.
- Definition Classes
- OptVar
- Annotations
- @inline()
- See also
flatMap
map
-
def
get(implicit action: Action): A
- Definition Classes
- OptVar
-
def
getAll(implicit action: Action): Session
- Definition Classes
- SessionVar → OptVar
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
-
final
def
getOrElse[B >: A](default: ⇒ B)(implicit action: Action): B
Returns the option's value if the option is nonempty, otherwise return the result of evaluating
default.Returns the option's value if the option is nonempty, otherwise return the result of evaluating
default.- default
the default expression.
- Definition Classes
- OptVar
- Annotations
- @inline()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
-
def
isDefined(implicit action: Action): Boolean
Returns true if the option is an instance of scala.Some, false otherwise.
Returns true if the option is an instance of scala.Some, false otherwise.
- Definition Classes
- OptVar
-
def
isEmpty(implicit action: Action): Boolean
Returns true if the option is
None, false otherwise.Returns true if the option is
None, false otherwise.- Definition Classes
- OptVar
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
iterator(implicit action: Action): Iterator[A]
Returns a singleton iterator returning the scala.Option's value if it is nonempty, or an empty iterator if the option is empty.
Returns a singleton iterator returning the scala.Option's value if it is nonempty, or an empty iterator if the option is empty.
- Definition Classes
- OptVar
-
val
key: String
- Attributes
- protected[this]
- Definition Classes
- OptVar
-
final
def
map[B](f: (A) ⇒ B)(implicit action: Action): Option[B]
Returns a scala.Some containing the result of applying
fto this scala.Option's value if this scala.Option is nonempty.Returns a scala.Some containing the result of applying
fto this scala.Option's value if this scala.Option is nonempty. Otherwise returnNone.- f
the function to apply
- Definition Classes
- OptVar
- Annotations
- @inline()
- Note
This is similar to
flatMapexcept here,fdoes not need to wrap its result in an scala.Option.- See also
foreach
flatMap
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
nonEmpty(implicit action: Action): Boolean
Returns false if the option is
None, true otherwise.Returns false if the option is
None, true otherwise.- Definition Classes
- OptVar
- Note
Implemented here to avoid the implicit conversion to Iterable.
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
-
final
def
orElse[B >: A](alternative: ⇒ Option[B])(implicit action: Action): Option[B]
Returns this scala.Option if it is nonempty, otherwise return the result of evaluating
alternative.Returns this scala.Option if it is nonempty, otherwise return the result of evaluating
alternative.- alternative
the alternative expression.
- Definition Classes
- OptVar
- Annotations
- @inline()
-
final
def
orNull[A1 >: A](implicit ev: <:<[Null, A1], action: Action): A1
Returns the option's value if it is nonempty, or
nullif it is empty.Returns the option's value if it is nonempty, or
nullif it is empty. Although the use of null is discouraged, code written to use scala.Option must often interface with code that expects and returns nulls.- Definition Classes
- OptVar
- Annotations
- @inline()
val initalText: Option[String] = getInitialText val textField = new JComponent(initalText.orNull,20)
Example: -
def
remove()(implicit action: Action): Option[A]
- Definition Classes
- OptVar
-
def
set[B >: A](value: B)(implicit action: Action): Unit
- Definition Classes
- OptVar
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
final
def
toLeft[X](right: ⇒ X)(implicit action: Action): Either[A, X]
Returns a scala.util.Right containing the given argument
rightif this is empty, or a scala.util.Left containing this scala.Option's value if this scala.Option is nonempty.Returns a scala.util.Right containing the given argument
rightif this is empty, or a scala.util.Left containing this scala.Option's value if this scala.Option is nonempty.- right
the expression to evaluate and return if this is empty
- Definition Classes
- OptVar
- Annotations
- @inline()
- See also
toRight
-
def
toList(implicit action: Action): List[A]
Returns a singleton list containing the scala.Option's value if it is nonempty, or the empty list if the scala.Option is empty.
Returns a singleton list containing the scala.Option's value if it is nonempty, or the empty list if the scala.Option is empty.
- Definition Classes
- OptVar
-
def
toOption(implicit action: Action): Option[A]
- Definition Classes
- OptVar
-
final
def
toRight[X](left: ⇒ X)(implicit action: Action): Either[X, A]
Returns a scala.util.Left containing the given argument
leftif this scala.Option is empty, or a scala.util.Right containing this scala.Option's value if this is nonempty.Returns a scala.util.Left containing the given argument
leftif this scala.Option is empty, or a scala.util.Right containing this scala.Option's value if this is nonempty.- left
the expression to evaluate and return if this is empty
- Definition Classes
- OptVar
- Annotations
- @inline()
- See also
toLeft
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
withFilter(p: (A) ⇒ Boolean)(implicit action: Action): WithFilter
Necessary to keep scala.Option from being implicitly converted to scala.collection.Iterable in
forcomprehensions.Necessary to keep scala.Option from being implicitly converted to scala.collection.Iterable in
forcomprehensions.- Definition Classes
- OptVar
- Annotations
- @inline()