public final class IxHelperFunctions
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static <T> rx.functions.Func0<java.util.ArrayList<T>> |
arrayListProvider()
A list creator factory.
|
static <T,U> rx.functions.Func1<U,java.util.ArrayList<T>> |
arrayListProvider1()
A list creator factory for Func1 that ignores the parameter.
|
static <T extends java.lang.Comparable<? super T>> |
comparator()
Returns a convenience comparator which basically compares
objects which implement the
Comparable
interface. |
static <T extends java.lang.Comparable<? super T>> |
comparator0()
Returns a convenience comparator which basically compares objects which implement the
Comparable
interface. |
static <T extends java.lang.Comparable<? super T>> |
comparatorReverse()
Creates a new comparator which reverses the order of the comparison.
|
static <T> java.util.Comparator<T> |
comparatorReverse(java.util.Comparator<? super T> normal)
Creates a new comparator which reverses the order produced by the given
normal comparator.
|
static <K,V> rx.functions.Func0<java.util.concurrent.ConcurrentHashMap<K,V>> |
concurrentHashMapProvider()
A map creator factory.
|
static <Param1,Result> |
constant(Result value)
Creates a function which returns always the same value.
|
static <T> rx.functions.Func0<T> |
constant0(T value)
Creates a function which returns always the same value.
|
static <K,V> rx.functions.Func0<java.util.HashMap<K,V>> |
hashMapProvider()
A map creator factory.
|
static <T> rx.functions.Func0<java.util.HashSet<T>> |
hashSetProvider()
A set creation provider.
|
static <T> rx.functions.Func1<T,T> |
identity() |
static <T,U> rx.functions.Func2<T,U,T> |
identityFirst()
Returns a helper function of two parameters which always returns its first parameter.
|
static <T,U> rx.functions.Func2<T,U,U> |
identitySecond()
Returns a helper function of two parameters which always returns its second parameter.
|
static <K,V> rx.functions.Func0<java.util.LinkedHashMap<K,V>> |
linkedHashMapProvider()
A map creator factory.
|
static <T> rx.functions.Func0<java.util.LinkedList<T>> |
linkedListProvider()
A list creator factory.
|
static <T extends java.lang.Comparable<? super T>> |
max()
Returns a function which returns the greater of its parameters.
|
static <T> rx.functions.Func2<T,T,T> |
max(java.util.Comparator<? super T> comparator)
Returns a function which returns the greater of its parameters in respect to the supplied
Comparator . |
static <T extends java.lang.Comparable<? super T>> |
min()
Returns a function which returns the smaller of its parameters.
|
static <T> rx.functions.Func2<T,T,T> |
min(java.util.Comparator<? super T> comparator)
Returns a function which returns the smaller of its parameters in respect to the supplied
Comparator . |
static rx.functions.Func1<java.lang.Boolean,java.lang.Boolean> |
negate() |
static rx.functions.Func2<java.math.BigDecimal,java.math.BigDecimal,java.math.BigDecimal> |
sumBigDecimal()
Retuns a function that adds two BigDecimal numbers and
returns a new one.
|
static rx.functions.Func2<java.math.BigInteger,java.math.BigInteger,java.math.BigInteger> |
sumBigInteger()
Retuns a function that adds two BigInteger numbers and
returns a new one.
|
static rx.functions.Func2<java.lang.Double,java.lang.Double,java.lang.Double> |
sumDouble()
Retuns a function that adds two Double number and
returns a new one.
|
static rx.functions.Func2<java.lang.Float,java.lang.Float,java.lang.Float> |
sumFloat()
Retuns a function that adds two Float number and
returns a new one.
|
static rx.functions.Func2<java.lang.Integer,java.lang.Integer,java.lang.Integer> |
sumInteger()
Retuns a function that adds two Integer number and
returns a new one.
|
static rx.functions.Func2<java.lang.Long,java.lang.Long,java.lang.Long> |
sumLong()
Retuns a function that adds two Long number and
returns a new one.
|
static <K,V> rx.functions.Func0<java.util.TreeMap<K,V>> |
treeMapProvider()
A map creator factory.
|
static <K,V> rx.functions.Func0<java.util.TreeMap<K,V>> |
treeMapProvider(java.util.Comparator<? super K> keyComparator)
A map creator factory.
|
static <T> rx.functions.Func0<java.util.TreeSet<T>> |
treeSetProvider()
A set creation provider.
|
static <T> rx.functions.Func0<java.util.TreeSet<T>> |
treeSetProvider(java.util.Comparator<? super T> elementComparator)
A set creation provider.
|
public static <Param1,Result> rx.functions.Func1<Param1,Result> constant(Result value)
Param1
- the parameter type, irrelevantResult
- the value type to returnvalue
- the value to returnpublic static <T> rx.functions.Func0<T> constant0(T value)
T
- the value type to returnvalue
- the value to returnpublic static <T extends java.lang.Comparable<? super T>> rx.functions.Func2<T,T,T> max()
T
- the parameter types, which must be self-comparablepublic static <T extends java.lang.Comparable<? super T>> rx.functions.Func2<T,T,T> min()
T
- the parameter types, which must be self-comparablepublic static <T,U> rx.functions.Func2<T,U,T> identityFirst()
T
- the result and the first parameter typeU
- the second parameter type, irrelevantpublic static <T,U> rx.functions.Func2<T,U,U> identitySecond()
T
- the result and the second parameter typeU
- the first parameter type, irrelevantpublic static <T> rx.functions.Func2<T,T,T> max(java.util.Comparator<? super T> comparator)
Comparator
.
If only one of the parameters is null, the other parameter is returned.
If both parameters are null, null is returned.T
- the parameter types, which must be self-comparablecomparator
- the value comparatorpublic static <T> rx.functions.Func2<T,T,T> min(java.util.Comparator<? super T> comparator)
Comparator
.
If only one of the parameters is null, the other parameter is returned.
If both parameters are null, null is returned.T
- the parameter types, which must be self-comparablecomparator
- the value comparatorpublic static <T extends java.lang.Comparable<? super T>> java.util.Comparator<T> comparator()
Comparable
interface. The comparator is null safe in the manner,
that nulls are always less than any non-nulls.
To have a comparator which places nulls last, use the comparator0()
method.T
- the element types to comparecomparator0()
public static <T extends java.lang.Comparable<? super T>> java.util.Comparator<T> comparator0()
Comparable
interface. The comparator is null safe in the manner, that nulls are always greater than any non-nulls.
To have a comparator which places nulls first, use the comparator()
method.T
- the element types to comparepublic static <T extends java.lang.Comparable<? super T>> java.util.Comparator<T> comparatorReverse()
T
- the element type, which must be self comparablepublic static <T> java.util.Comparator<T> comparatorReverse(java.util.Comparator<? super T> normal)
T
- the element typenormal
- the normal comparatorpublic static rx.functions.Func2<java.math.BigDecimal,java.math.BigDecimal,java.math.BigDecimal> sumBigDecimal()
If the first parameter is null, it returns the second parameter.
public static rx.functions.Func2<java.math.BigInteger,java.math.BigInteger,java.math.BigInteger> sumBigInteger()
If the first parameter is null, it returns the second parameter.
public static rx.functions.Func2<java.lang.Double,java.lang.Double,java.lang.Double> sumDouble()
If the first parameter is null, it returns the second parameter.
public static rx.functions.Func2<java.lang.Float,java.lang.Float,java.lang.Float> sumFloat()
If the first parameter is null, it returns the second parameter.
public static rx.functions.Func2<java.lang.Integer,java.lang.Integer,java.lang.Integer> sumInteger()
If the first parameter is null, it returns the second parameter.
public static rx.functions.Func2<java.lang.Long,java.lang.Long,java.lang.Long> sumLong()
If the first parameter is null, it returns the second parameter.
public static <T> rx.functions.Func0<java.util.ArrayList<T>> arrayListProvider()
T
- the value typepublic static <T,U> rx.functions.Func1<U,java.util.ArrayList<T>> arrayListProvider1()
T
- the value typeU
- the function parameter type, ignoredpublic static <T> rx.functions.Func0<java.util.LinkedList<T>> linkedListProvider()
T
- the value typepublic static <K,V> rx.functions.Func0<java.util.HashMap<K,V>> hashMapProvider()
K
- the key typeV
- the value typepublic static <K,V> rx.functions.Func0<java.util.TreeMap<K,V>> treeMapProvider()
K
- the key typeV
- the value typepublic static <K,V> rx.functions.Func0<java.util.TreeMap<K,V>> treeMapProvider(java.util.Comparator<? super K> keyComparator)
K
- the key typeV
- the value typekeyComparator
- the key comparator functionpublic static <K,V> rx.functions.Func0<java.util.LinkedHashMap<K,V>> linkedHashMapProvider()
K
- the key typeV
- the value typepublic static <K,V> rx.functions.Func0<java.util.concurrent.ConcurrentHashMap<K,V>> concurrentHashMapProvider()
K
- the key typeV
- the value typepublic static <T> rx.functions.Func0<java.util.HashSet<T>> hashSetProvider()
T
- the element typepublic static <T> rx.functions.Func0<java.util.TreeSet<T>> treeSetProvider()
T
- the element typepublic static <T> rx.functions.Func0<java.util.TreeSet<T>> treeSetProvider(java.util.Comparator<? super T> elementComparator)
T
- the element typeelementComparator
- the custom element comparatorpublic static rx.functions.Func1<java.lang.Boolean,java.lang.Boolean> negate()
public static <T> rx.functions.Func1<T,T> identity()
T
- the input and result type