Boolean (equivalent to Java's boolean primitive type) is a subtype of scala.AnyVal. Instances of Boolean are not represented by an object in the underlying runtime system.
There is an implicit conversion from scala.Boolean => scala.runtime.RichBoolean which provides useful non-primitive operations.
Attributes
- Companion
- object
- Source
- Boolean.scala
- Graph
-
- Supertypes
Members list
Value members
Abstract methods
Compares two Boolean expressions and returns true if they evaluate to a different value.
Compares two Boolean expressions and returns true if they evaluate to a different value.
a != b returns true if and only if
aistrueandbisfalseoraisfalseandbistrue.
Attributes
- Source
- Boolean.scala
Compares two Boolean expressions and returns true if both of them evaluate to true.
Compares two Boolean expressions and returns true if both of them evaluate to true.
a & b returns true if and only if
aandbaretrue.
Value parameters
- x
-
the right-hand operand, always evaluated
Attributes
- Returns
-
trueif both operands aretrue,falseotherwise - Note
-
This method evaluates both
aandb, even if the result is already determined after evaluatinga. - Source
- Boolean.scala
Compares two Boolean expressions and returns true if both of them evaluate to true.
Compares two Boolean expressions and returns true if both of them evaluate to true.
a && b returns true if and only if
aandbaretrue.
Value parameters
- x
-
the right-hand operand, only evaluated if
thisistrue
Attributes
- Returns
-
trueif both operands aretrue,falseotherwise - Note
-
This method uses 'short-circuit' evaluation and behaves as if it was declared as
def &&(x: => Boolean): Boolean. Ifaevaluates tofalse,falseis returned without evaluatingb. - Source
- Boolean.scala
Compares two Boolean expressions and returns true if they evaluate to the same value.
Compares two Boolean expressions and returns true if they evaluate to the same value.
a == b returns true if and only if
aandbaretrueoraandbarefalse.
Attributes
- Source
- Boolean.scala
Compares two Boolean expressions and returns true if they evaluate to a different value.
Compares two Boolean expressions and returns true if they evaluate to a different value.
a ^ b returns true if and only if
aistrueandbisfalseoraisfalseandbistrue.
Value parameters
- x
-
the right-hand operand
Attributes
- Returns
-
trueif the operands evaluate to different values,falseotherwise - Source
- Boolean.scala
Negates a Boolean expression.
Negates a Boolean expression.
!aresults infalseif and only ifaevaluates totrueand!aresults intrueif and only ifaevaluates tofalse.
Attributes
- Returns
-
the negated expression
- Source
- Boolean.scala
Compares two Boolean expressions and returns true if one or both of them evaluate to true.
Compares two Boolean expressions and returns true if one or both of them evaluate to true.
a | b returns true if and only if
aistrueorbistrueoraandbaretrue.
Value parameters
- x
-
the right-hand operand, always evaluated
Attributes
- Returns
-
trueif at least one operand istrue,falseotherwise - Note
-
This method evaluates both
aandb, even if the result is already determined after evaluatinga. - Source
- Boolean.scala
Compares two Boolean expressions and returns true if one or both of them evaluate to true.
Compares two Boolean expressions and returns true if one or both of them evaluate to true.
a || b returns true if and only if
aistrueorbistrueoraandbaretrue.
Value parameters
- x
-
the right-hand operand, only evaluated if
thisisfalse
Attributes
- Returns
-
trueif at least one operand istrue,falseotherwise - Note
-
This method uses 'short-circuit' evaluation and behaves as if it was declared as
def ||(x: => Boolean): Boolean. Ifaevaluates totrue,trueis returned without evaluatingb. - Source
- Boolean.scala