This class is used for a parser failure, and contains the error message.
Attributes
- Err
the type of the error message generated by the failing parse.
- _msg
the error message reported by the parser (passed lazily).
- Companion:
- object
- Source:
- Result.scala
- Graph
- Supertypes
Members list
Value members
Concrete methods
Attributes
- Definition Classes
- Source:
- Result.scala
Attributes
- Source:
- Result.scala
Compares the receiver object (this
) with the argument object (that
) for equivalence.
Compares the receiver object (this
) with the argument object (that
) for equivalence.
Any implementation of this method should be an equivalence relation:
- It is reflexive: for any instance x
of type Any
, x.equals(x)
should return true
.
- It is symmetric: for any instances x
and y
of type Any
, x.equals(y)
should return true
if and
only if y.equals(x)
returns true
.
- It is transitive: for any instances x
, y
, and z
of type Any
if x.equals(y)
returns true
and
y.equals(z)
returns true
, then x.equals(z)
should return true
.
If you override this method, you should verify that your implementation remains an equivalence relation.
Additionally, when overriding this method it is usually necessary to override hashCode
to ensure that
objects which are "equal" (o1.equals(o2)
returns true
) hash to the same scala.Int.
(o1.hashCode.equals(o2.hashCode)
).
Attributes
- that
the object to compare against this object for equality.
- Returns:
true
if the receiver object is equivalent to the argument;false
otherwise.- Definition Classes
- Equals -> Any
- Source:
- Result.scala
Returns the successful value within the result.
Returns the successful value within the result.
This is equivalent to:
result match {
case Success(x) => x
case _ => throw new Exception
}
Attributes
- Definition Classes
- Source:
- Result.scala
Calculate a hash code value for the object.
Calculate a hash code value for the object.
The default hashing algorithm is platform dependent.
Note that it is allowed for two objects to have identical hash codes (o1.hashCode.equals(o2.hashCode)
) yet
not be equal (o1.equals(o2)
returns false
). A degenerate implementation could always return 0
.
However, it is required that if two objects are equal (o1.equals(o2)
returns true
) that they have
identical hash codes (o1.hashCode.equals(o2.hashCode)
). Therefore, when overriding this method, be sure
to verify that the behavior is consistent with the equals
method.
Attributes
- Returns:
the hash code value for this object.
- Definition Classes
- Any
- Source:
- Result.scala
Returns true
if this is a Failure
, false
otherwise.
Returns true
if this is a Success
, false
otherwise.
Attributes
- Definition Classes
- Source:
- Result.scala
Attributes
- Definition Classes
- Source:
- Result.scala
Attributes
- Definition Classes
- Source:
- Result.scala
Returns a string representation of the object.
Returns a string representation of the object.
The default representation is platform dependent.
Attributes
- Returns:
a string representation of the object.
- Definition Classes
- Any
- Source:
- Result.scala
Inherited methods
Returns true
if this result is a Success
and its value is equal to elem
(as determined by ==
),
returns false
otherwise.
Returns true
if this result is a Success
and its value is equal to elem
(as determined by ==
),
returns false
otherwise.
Attributes
- elem
the element to test.
- Returns:
true
if this is aSuccess
value equal toelem
.- Since:
1.7.0
- Inherited from:
- Result
- Source:
- Result.scala
Returns false
if Failure
or returns the result of the application of
the given predicate to the Success
value.
Returns false
if Failure
or returns the result of the application of
the given predicate to the Success
value.
Attributes
- Since:
1.7.0
- Inherited from:
- Result
- Source:
- Result.scala
Returns Success
with the existing value of Success
if this is a Success
and the given predicate p
holds for the right value,
or Failure(msg)
if this is a Success
and the given predicate p
does not hold for the right value,
or Failure
with the existing value of Failure
if this is a Failure
.
Returns Success
with the existing value of Success
if this is a Success
and the given predicate p
holds for the right value,
or Failure(msg)
if this is a Success
and the given predicate p
does not hold for the right value,
or Failure
with the existing value of Failure
if this is a Failure
.
Attributes
- Since:
1.7.0
- Inherited from:
- Result
- Source:
- Result.scala
Returns the result of applying f
to this result if it is a success.
Returns the result of applying f
to this result if it is a success. Returns
a failure if this result is a failure. Differs from map
as f
returns a result
instead of just a value.
Attributes
- Since:
1.7.0
- Inherited from:
- Result
- Source:
- Result.scala
Returns the nested result if this result is a success, otherwise return this failure.
Returns the nested result if this result is a success, otherwise return this failure.
Equivalent to flatMap(identity[Result[Errʹ, B]])
.
Attributes
- Since:
1.7.0
- Inherited from:
- Result
- Source:
- Result.scala
Returns the result of applying ferr
to this result's error if this is a Failure
or fa
to the result stored in the Success
otherwise.
Returns the result of applying ferr
to this result's error if this is a Failure
or fa
to the result stored in the Success
otherwise.
Attributes
- fa
the function to apply if this is a
Success
.- ferr
the function to apply if this is a
Failure
.- Returns:
the results of applying the function
- Since:
1.7.0
- Inherited from:
- Result
- Source:
- Result.scala
Returns true
if this result is a Failure
or returns the result of the application of
the given predicate to the Success
value.
Returns true
if this result is a Failure
or returns the result of the application of
the given predicate to the Success
value.
Attributes
- Since:
1.7.0
- Inherited from:
- Result
- Source:
- Result.scala
Executes the procedure f
if this is a Success
.
Executes the procedure f
if this is a Success
. Otherwise, do nothing.
This is equivalent to:
result match {
case Success(x) => f(x)
case _ => ()
}
Attributes
- f
The side-effecting function to execute.
- Since:
1.7.0
- Inherited from:
- Result
- Source:
- Result.scala
Returns the value from this Success
or the result of evaluating default
if this is a Failure
.
Returns the value from this Success
or the result of evaluating default
if this is a Failure
.
Attributes
- Since:
1.7.0
- Inherited from:
- Result
- Source:
- Result.scala
Returns a Success
containing the result of applying f
to this result's value if
this is a success.
Returns a Success
containing the result of applying f
to this result's value if
this is a success. Otherwise, returns a failure.
Attributes
- Since:
1.7.0
- Inherited from:
- Result
- Source:
- Result.scala
Returns this result if it is a Success
, otherwise return the result of evaluating alternative
.
Returns this result if it is a Success
, otherwise return the result of evaluating alternative
.
Attributes
- Since:
1.7.0
- Inherited from:
- Result
- Source:
- Result.scala
Attributes
- Inherited from:
- Product
Attributes
- Inherited from:
- Product
Attributes
- Inherited from:
- Product
Converts the Result
into a Either
where Failure
maps to a Left[Err]
.
Converts the Result
into a Either
where Failure
maps to a Left[Err]
.
Attributes
- Since:
1.7.0
- Inherited from:
- Result
- Source:
- Result.scala
Returns a Some
containing the Success
value if it exists or a None
if this is a Failure
.
Returns a Some
containing the Success
value if it exists or a None
if this is a Failure
.
Attributes
- Since:
1.7.0
- Inherited from:
- Result
- Source:
- Result.scala
Returns a Seq
containing the Success
value if it exists or an empty Seq
if this is a Failure
.
Returns a Seq
containing the Success
value if it exists or an empty Seq
if this is a Failure
.
Attributes
- Since:
1.7.0
- Inherited from:
- Result
- Source:
- Result.scala
Converts the Result
into a Try
where Failure
maps to a plain Exception
.
Converts the Result
into a Try
where Failure
maps to a plain Exception
.
Attributes
- Since:
1.7.0
- Inherited from:
- Result
- Source:
- Result.scala
Concrete fields
Attributes
- Source:
- Result.scala