Skip navigation links
A C D E F G H I J M N O S T 

A

apply(T) - Static method in interface javascalautils.Option
Creates an instance of Option.
If a null value is provided then None is returned, else Some containing the provided value.
apply(T) - Static method in interface javascalautils.Try
Creates an instance of Try.
If a null or non-throwable value is provided then Success is returned containing the value, else Failure containing the provided throwable.
asOption() - Method in interface javascalautils.Try
Returns this Try as an Option.
asOptional() - Method in interface javascalautils.Option
Converts this Option to a corresponding Optional.

C

contains(T) - Method in interface javascalautils.Option
Returns true if this is a Some containing the provided object, else false.
count() - Method in interface javascalautils.Option
Returns the count which means 1 for nonempty Option's and 0 for empty.

D

DEFAULT_NONE - Static variable in interface javascalautils.Option
This is a singleton None since it anyways cannot represent a state.
Can also be accessed using Option.empty()

E

empty() - Static method in interface javascalautils.Option
Creates an empty Option.
In practice this returns a singleton as it anyways cannot represent a value/state.
equals(Object) - Method in class javascalautils.None
Always returns true as None is stateless comparing it to some other None is therefore always the same.
equals(Object) - Method in class javascalautils.Some
Returns true if the other object is Some containing a value that equals the value of this Some, else false.
exists(Predicate<T>) - Method in class javascalautils.None
Always returns false.
exists(Predicate<T>) - Method in interface javascalautils.Option
Returns true if this option is nonempty and the predicate p returns true when applied to this Option's value.
exists(Predicate<T>) - Method in class javascalautils.Some
Returns true if the predicate matches the value.

F

failed() - Method in class javascalautils.Failure
Always returns a Success with the Throwable provided in the constructor.
failed() - Method in class javascalautils.Success
Always returns a Failure with an UnsupportedOperationException.
failed() - Method in interface javascalautils.Try
Completes this 'Try' with an exception wrapped in a Success.
The exception is either the exception that the 'Try' failed with (if a Failure) or an 'UnsupportedOperationException'.
Failure<T> - Class in javascalautils
Represents the 'failed' implementation of Try.
Failure(Throwable) - Constructor for class javascalautils.Failure
Creates a Failure for the provided Throwable.
Null values are not allowed.
filter(Predicate<T>) - Method in interface javascalautils.Option
Returns this Option if it is nonempty and applying the predicate p to this Option's value returns true.
filterNot(Predicate<T>) - Method in interface javascalautils.Option
Returns this Option if it is nonempty and applying the predicate p to this Option's value returns false.
forall(Predicate<T>) - Method in interface javascalautils.Option
Returns true if the Option is nonempty and the predicate holds true, else false.
In an essence exactly the same as Option.exists(Predicate).

G

get() - Method in class javascalautils.Failure
Always throws the Throwable provided in the constructor.
get() - Method in class javascalautils.None
Always throws NoSuchElementException since None cannot hold any value.
get() - Method in interface javascalautils.Option
Returns this Option's value if such exists, else NoSuchElementException is raised.
get() - Method in class javascalautils.Some
Always returns the value.
get() - Method in class javascalautils.Success
Always returns the value provided in the constructor.
get() - Method in interface javascalautils.Try
Returns the value from this Success or throws the exception if this is a Failure.
getOrElse(Supplier<T>) - Method in class javascalautils.Failure
Always returns the provided default value.
getOrElse(Supplier<T>) - Method in class javascalautils.None
Always the value provided by the supplier.
getOrElse(Supplier<T>) - Method in interface javascalautils.Option
Returns this Option's value if such exists, else the value provided by the supplier.
getOrElse(Supplier<T>) - Method in class javascalautils.Some
Always returns the value.
getOrElse(Supplier<T>) - Method in class javascalautils.Success
Always returns the value provided in the constructor.
getOrElse(Supplier<T>) - Method in interface javascalautils.Try
Returns the value from this Success or the value provided by the supplier if this is a Failure.

H

hashCode() - Method in class javascalautils.None
Always returns 0 as None is stateless and has no value.
hashCode() - Method in class javascalautils.Some
Returns the hashCode based on the value of this Some.

I

isDefined() - Method in interface javascalautils.Option
Returns true if the option is an instance of Some, false otherwise.
isEmpty() - Method in interface javascalautils.Option
Returns true if the option is an instance of None, false otherwise
isFailure() - Method in interface javascalautils.Try
Returns true if the 'Try' is a Failure, false otherwise.
isSuccess() - Method in class javascalautils.Failure
Always returns false.
isSuccess() - Method in class javascalautils.Success
Always returns true.
isSuccess() - Method in interface javascalautils.Try
Returns true if the 'Try' is a Success, false otherwise.
iterator() - Method in interface javascalautils.Option
Returns the Option's value in an Iterator if it is nonempty, or an empty Iterator if it is empty.
iterator() - Method in interface javascalautils.Try
Returns the Try's value in an Iterator if it is a Success, or an empty Iterator if it is Failure.

J

javascalautils - package javascalautils
Introducing some of the core concepts of Scala into Java.
The aim with these utility classes is to provide neat and concise programming patterns.
Details and Wiki can be found at:
https://github.com/pnerg/java-scala-util

M

map(Function<T, R>) - Method in class javascalautils.Failure
Always returns this
map(Function<T, R>) - Method in class javascalautils.None
Always returns this.
map(Function<T, R>) - Method in interface javascalautils.Option
Returns an Option consisting of the result of applying the given function to the current Some.
map(Function<T, R>) - Method in class javascalautils.Some
Returns an Option consisting of the result of applying the given function to the current value.
map(Function<T, R>) - Method in class javascalautils.Success
Applies the value to the function and returns the Try representing the mapped value.
map(Function<T, R>) - Method in interface javascalautils.Try
Maps the given function to the value from this Success or returns this if this is a Failure.

N

None<T> - Class in javascalautils
Represents an empty Option.
None() - Constructor for class javascalautils.None
 

O

ofOptional(Optional<T>) - Static method in interface javascalautils.Option
Converts the Optional to a corresponding Option.
Option<T> - Interface in javascalautils
Represents optional values.
orElse(Supplier<Try<T>>) - Method in class javascalautils.Failure
Always returns the provided default value.
orElse(Supplier<Option<T>>) - Method in class javascalautils.None
Always the value provided by the supplier.
orElse(Supplier<Option<T>>) - Method in interface javascalautils.Option
Returns this Option if it is nonempty, otherwise return the result of provided by the supplier.
orElse(Supplier<Option<T>>) - Method in class javascalautils.Some
Always returns this.
orElse(Supplier<Try<T>>) - Method in class javascalautils.Success
Always returns this.
orElse(Supplier<Try<T>>) - Method in interface javascalautils.Try
Returns this 'Try' if it's a Success or the value provided by the supplier if this is a Failure.
orNull() - Method in interface javascalautils.Option
Returns the Option's value if it is nonempty, or null if it is empty.
orNull() - Method in interface javascalautils.Try
Returns the value if it is a Success, else null.

S

Some<T> - Class in javascalautils
Represents an Option holding a value.
Some(T) - Constructor for class javascalautils.Some
Creates an instance for the provided value.
stream() - Method in class javascalautils.None
Always returns an empty stream.
stream() - Method in interface javascalautils.Option
Returns the Option's value in a Stream if it is nonempty, or an empty Stream if it is empty.
stream() - Method in class javascalautils.Some
Returns a stream of size one containing the value.
stream() - Method in interface javascalautils.Try
Returns the Try's value in a Stream if it is a Success, or an empty Stream if it is a Failure.
Should it be a Success containing a null value then the stream will also be empty.
Success<T> - Class in javascalautils
Represents the 'successful' implementation of Try.
Success(T) - Constructor for class javascalautils.Success
Creates a 'successful' instance with the provided value.
Null values are allowed.

T

toString() - Method in class javascalautils.Failure
 
toString() - Method in class javascalautils.None
 
toString() - Method in class javascalautils.Some
 
toString() - Method in class javascalautils.Success
 
Try<T> - Interface in javascalautils
The 'Try' type represents a computation that may either result in an exception, or return a successfully computed value.
A C D E F G H I J M N O S T 
Skip navigation links

Copyright © 2015. All rights reserved.