Novah Documentation

novah.java

Functions for Java interoperability.

Types

Declarations


class

visibility: public
type: a -> Class a

Returns the Java class of this object.


hashCode

visibility: public
type: a -> Int32

Returns the hash code for this value using the native Java hashCode method of x.


equals

visibility: public
type: a -> a -> Boolean

Returns true if x is equals y using the native Java equals method of x.


isInstance

visibility: public
type: a -> Class b -> Boolean

Returns true if the given object is an instance of the class.


assignableFrom

visibility: public
type: Class a -> Class b -> Boolean

Returns true if clazz1 is a superclass or superinterface of class2.


assert

visibility: public
type: Boolean -> String -> Unit

Throws an assertion error if the condition is false.


error

visibility: public
type: String -> a

Throws an error with the given message that should not be caught


forEach

visibility: public
type: Iterator a -> (a -> Unit) -> Unit

Executes the function for each value in this iterator. Runtime: O(n)


exit

visibility: public
type: Int32 -> Unit

Terminates the currently running JVM with the given status. A status different from 0 indicates abnormal termination.


toComparator

visibility: public
type: (a -> a -> Ordering) -> Comparator a

Returns a java.util.Comparator based on this ordering function.


consumer

visibility: public
type: (a -> Unit) -> Consumer a

Creates a java.util.function.Consumer out of this function.


runnable

visibility: public
type: (Unit -> Unit) -> Runnable

Creates a java.lang.Runnable out of this function, ignoring the result.


callable

visibility: public
type: (Unit -> a) -> Callable a

Creates a java.util.concurrent.Callable out of this function.


supplier

visibility: public
type: (Unit -> a) -> Supplier a

Creates a java.util.function.Supplier out of this function.


predicate

visibility: public
type: (a -> Boolean) -> Predicate a

Creates a java.util.function.Predicate out of this function.


bipredicate

visibility: public
type: (a -> b -> Boolean) -> BiPredicate a b

Creates a java.util.function.BiPredicate out of this function.


toLongFunction

visibility: public
type: (a -> Int64) -> ToLongFunction a

Creates a java.util.function.ToLongFunction out of this function.


toIntFunction

visibility: public
type: (a -> Int32) -> ToIntFunction a

Creates a java.util.function.ToIntFunction out of this function.


intFunction

visibility: public
type: (Int32 -> a) -> IntFunction a

Creates a java.util.function.IntFunction out of this function.


binaryOperator

visibility: public
type: (a -> a -> a) -> BinaryOperator a

Creates a java.util.function.BinaryOperator out of this function.


unaryOperator

visibility: public
type: (a -> a) -> UnaryOperator a

Creates a java.util.function.UnaryOperator out of this function.


biFunction

visibility: public
type: (a -> b -> c) -> BiFunction a b c

Creates a java.util.function.BiFunction out of this function.