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

A

apply() - Static method in interface javascalautils.concurrent.Promise
Creates an instance of Promise.
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.
awaitTermination(long, TimeUnit) - Method in interface javascalautils.concurrent.Executor
Blocks until all tasks have completed execution after a shutdown request, or the timeout occurs, or the current thread is interrupted, whichever happens first.

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.
create(Executor) - Static method in class javascalautils.concurrent.Executors
Creates an executor that uses the provided Java concurrent executor for the actual job processing
createCachedThreadPoolExecutor(ThreadFactory) - Static method in class javascalautils.concurrent.Executors
Creates an executor that uses the Executors.newCachedThreadPool(ThreadFactory).
createFixedThreadPoolExecutor(int, ThreadFactory) - Static method in class javascalautils.concurrent.Executors
Creates an executor that uses the Executors.newFixedThreadPool(int,ThreadFactory)

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

Either<L,R> - Interface in javascalautils
Represents a value of one of two possible types.
empty() - Static method in interface javascalautils.Option
Returns 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.
Executable<T> - Interface in javascalautils.concurrent
A task that returns either a successful or failed result.
Implementors define a single method with called execute.
execute(Promise<T>) - Method in interface javascalautils.concurrent.Executable
Execute the job.
Any response needs to be reported via either Promise,success(T) or failure(Throwable).
execute(Executable<T>) - Method in interface javascalautils.concurrent.Executor
Executes the provided Executable sometime in the future.
execute(Callable<T>) - Method in interface javascalautils.concurrent.Executor
Executes the provided Callable sometime in the future.
executeAll(Executable<T>...) - Method in interface javascalautils.concurrent.Executor
Executes the list of provided Executable sometime in the future.
executeAll(Callable<T>...) - Method in interface javascalautils.concurrent.Executor
Executes the list of provided Callable sometime in the future.
Executor - Interface in javascalautils.concurrent
Executor service used to execute work in asynchronous fashion.
Executors - Class in javascalautils.concurrent
Factory for creating Executor instances.
exists(Predicate<L>) - Method in class javascalautils.LeftProjection
Returns false if Right or returns the result of applying the predicate to the Left value.
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<R>) - Method in class javascalautils.RightProjection
Returns false if Left or returns the result of applying the predicate to the Right 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(Throwable) - Method in interface javascalautils.concurrent.Promise
Completes the Promise with an exception.
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.concurrent.Future
Creates a new Future that will filter the successful value of this instance once it is completed.
filter(Predicate<L>) - Method in class javascalautils.LeftProjection
Returns a Some wrapping the Either if it's a Left and the value of the Left matches the predicate, else None .
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.
filter(Predicate<R>) - Method in class javascalautils.RightProjection
Returns a Some wrapping the Either if it's a Right and the value of the Right matches the predicate, else None .
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.
flatMap(Function<T, Future<R>>) - Method in interface javascalautils.concurrent.Future
Creates a new Future that will hold the mapped successful value of this instance once it is completed.
flatMap(Function<T, Try<R>>) - Method in class javascalautils.Failure
Always returns this
flatMap(Function<L, Left<T, R>>) - Method in class javascalautils.LeftProjection
If this projection contains a Left then a new Left is returned containing the value from the original Right mapped via the provided function, else the contained Either is returned as is.
flatMap(Function<T, Option<R>>) - Method in class javascalautils.None
Always returns this.
flatMap(Function<T, Option<R>>) - Method in interface javascalautils.Option
Returns an Option consisting of the result of applying the given function to the current Some.
flatMap(Function<R, Right<L, T>>) - Method in class javascalautils.RightProjection
If this projection contains a Right then a new Right is returned containing the value from the original Right mapped via the provided function, else the contained Either is returned as is.
flatMap(Function<T, Option<R>>) - Method in class javascalautils.Some
Returns an Option consisting of the result of applying the given function to the current value.
flatMap(Function<T, Try<R>>) - Method in class javascalautils.Success
 
flatMap(Function<T, Try<R>>) - Method in interface javascalautils.Try
Maps the given function to the value from this Success or returns this if this is a Failure.
fold(Function<L, T>, Function<R, T>) - Method in interface javascalautils.Either
Applies func_left if this is a Left or func_right if this is a Right
fold(Function<L, T>, Function<R, T>) - Method in class javascalautils.Left
Applies the provided func_left to the wrapped value and returns the result.
fold(Function<L, T>, Function<R, T>) - Method in class javascalautils.Right
Applies the provided func_right to the wrapped value and returns the result.
forAll(Predicate<L>) - Method in class javascalautils.LeftProjection
Returns true if Right or returns the result of applying the predicate to the Left value.
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).
forAll(Predicate<R>) - Method in class javascalautils.RightProjection
Returns true if Left or returns the result of applying the predicate to the Right value.
forEach(Consumer<T>) - Method in interface javascalautils.concurrent.Future
Asynchronously processes the value in the Future once it is available.
Future<T> - Interface in javascalautils.concurrent
A Future that holds the result of a computation executed asynchronously.
future() - Method in interface javascalautils.concurrent.Promise
Get a Future that will hold the value once this Promise is completed.

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<L>) - Method in class javascalautils.LeftProjection
Returns the value if this is a Left else the value provided by the supplier.
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<R>) - Method in class javascalautils.RightProjection
Returns the value if this is a Right 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

isCompleted() - Method in interface javascalautils.concurrent.Future
Check if this Future is completed, with a value or an exception.
isCompleted() - Method in interface javascalautils.concurrent.Promise
Check if the Promise have been completed, with a value or an exception.
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.
isLeft() - Method in interface javascalautils.Either
Returnstrue if this instance is Left, else false
isRight() - Method in interface javascalautils.Either
Returnstrue if this instance is Right, else false.
isRight() - Method in class javascalautils.Left
Always returns false.
isRight() - Method in class javascalautils.Right
Always returns true.
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
javascalautils.concurrent - package javascalautils.concurrent
Contains utilities for concurrent/asynchronous programming.

L

left() - Method in interface javascalautils.Either
Returns a LeftProjection for this instance.
Left<L,R> - Class in javascalautils
Represents the Left side of an Either.
Left(L) - Constructor for class javascalautils.Left
Creates an instance wrapping the provide value.
LeftProjection<L,R> - Class in javascalautils
This is a left-biased wrapper for an instance of Either.

M

map(Function<T, R>) - Method in interface javascalautils.concurrent.Future
Creates a new Future that will hold the mapped successful value of this instance once it is completed.
map(Function<T, R>) - Method in class javascalautils.Failure
Always returns this
map(Function<L, T>) - Method in class javascalautils.LeftProjection
If this projection contains a Left then a new Left is returned containing the value from the original Right mapped via the provided function, else the contained Either is returned as is.
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<R, T>) - Method in class javascalautils.RightProjection
If this projection contains a Right then a new Right is returned containing the value from the original Right mapped via the provided function, else the contained Either is returned as is.
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

NamedSequenceThreadFactory - Class in javascalautils.concurrent
Thread factory for providing meaningful names to the created threads.
NamedSequenceThreadFactory(String) - Constructor for class javascalautils.concurrent.NamedSequenceThreadFactory
Create the factory.
newThread(Runnable) - Method in class javascalautils.concurrent.NamedSequenceThreadFactory
Creates a new thread using the provided name and sequence counter.
None<T> - Class in javascalautils
Represents an empty Option.
None() - Constructor for class javascalautils.None
 
None() - Static method in interface javascalautils.Option
Returns an empty Option.
This is the same as Option.empty() but with the difference it provides a more Scala like feeling if the method is statically imported.

O

ofOptional(Optional<T>) - Static method in interface javascalautils.Option
Converts the Optional to a corresponding Option.
onComplete(Consumer<Try<T>>) - Method in interface javascalautils.concurrent.Future
Register a handler to be invoked if the Future gets completed with a value or a failure.
onFailure(Consumer<Throwable>) - Method in interface javascalautils.concurrent.Future
Register a handler to be invoked if the Future gets completed with an exception.
onSuccess(Consumer<T>) - Method in interface javascalautils.concurrent.Future
Register a handler to be invoked if the Future gets completed with a value.
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.

P

Promise<T> - Interface in javascalautils.concurrent
A Promise that can be completed once with a value or failed once with an exception.

R

result(long, TimeUnit) - Method in interface javascalautils.concurrent.Future
Blocks and waits for this Future to complete.
right() - Method in interface javascalautils.Either
Returns a RightProjection for this instance.
Right<L,R> - Class in javascalautils
Represents the Right side of an Either.
Right(R) - Constructor for class javascalautils.Right
Creates an instance wrapping the provide value.
RightProjection<L,R> - Class in javascalautils
This is a right-biased wrapper for an instance of Either.

S

shutdown() - Method in interface javascalautils.concurrent.Executor
Initiates an orderly shutdown in which previously submitted tasks are executed, but no new tasks will be accepted.
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) - Method in interface javascalautils.concurrent.Promise
Completes the Promise with a value.
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.
swap() - Method in interface javascalautils.Either
If this is a Left, then return the left value in Right or vice versa.
swap() - Method in class javascalautils.Left
Returns a Right containing the value for this instance.
swap() - Method in class javascalautils.Right
Returns a Left containing the value for this instance.

T

toString() - Method in class javascalautils.Failure
 
toString() - Method in class javascalautils.Left
 
toString() - Method in class javascalautils.None
 
toString() - Method in class javascalautils.Right
 
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.

V

value() - Method in interface javascalautils.concurrent.Future
The value of the future.
A C D E F G H I J L M N O P R S T V 
Skip navigation links

Copyright © 2015. All rights reserved.