public final class Fun extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
Fun.ArrayComparator
compares two arrays using given comparators
|
static interface |
Fun.Function0<R>
function which takes no argument and returns one value
|
static interface |
Fun.Function1<R,A>
function which takes one argument and returns one value
|
static interface |
Fun.Function1Int<R>
function which takes one int argument and returns one value
|
static interface |
Fun.Function2<R,A,B>
function which takes two argument and returns one value
|
static class |
Fun.Pair<A,B> |
static interface |
Fun.RecordCondition<A>
decides if some action should be executed on an record
|
| Modifier and Type | Field and Description |
|---|---|
static Comparator<byte[]> |
BYTE_ARRAY_COMPARATOR |
static Comparator<char[]> |
CHAR_ARRAY_COMPARATOR |
static Comparator<Object[]> |
COMPARABLE_ARRAY_COMPARATOR
Compares two arrays which contains comparable elements
|
static Comparator |
COMPARATOR |
static Comparator<double[]> |
DOUBLE_ARRAY_COMPARATOR |
static Iterator |
EMPTY_ITERATOR |
static Comparator<int[]> |
INT_ARRAY_COMPARATOR |
static Comparator<long[]> |
LONG_ARRAY_COMPARATOR |
static Object |
PLACEHOLDER
place holder for some stuff in future
|
static Fun.RecordCondition |
RECORD_ALWAYS_TRUE
record condition which always returns true
|
static Comparator |
REVERSE_COMPARATOR |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
arrayContains(long[] longs,
long val) |
static <T> Comparator<T> |
comparator()
A utility method for getting a type-safe Comparator, it provides type-inference help.
|
static int |
compareInt(int x,
int y) |
static int |
compareLong(long x,
long y) |
static <T> Iterator<T> |
emptyIterator() |
static boolean |
eq(Object a,
Object b)
returns true if all elements are equal, works with nulls
|
static <K,V> Fun.Function1<K,Fun.Pair<K,V>> |
extractKey() |
static <K,V> Fun.Function1<K,Map.Entry<K,V>> |
extractMapEntryKey() |
static <K,V> Fun.Function1<V,Map.Entry<K,V>> |
extractMapEntryValue() |
static <K> Fun.Function1<K,K> |
extractNoTransform()
returns function which always returns the value itself without transformation
|
static <K,V> Fun.Function1<V,Fun.Pair<K,V>> |
extractValue() |
static Iterable<Object[]> |
filter(NavigableSet<Object[]> set,
Object... keys)
TODO document tuples
Find all Primary Keys associated with Secondary Key.
|
static <T> Comparator<T> |
reverseComparator()
A utility method for getting a type-safe reversed Comparator (the negation of
comparator()). |
static long |
roundDown(long number,
long roundDownToMultipleOf) |
static long |
roundUp(long number,
long roundUpToMultipleOf) |
public static final Object PLACEHOLDER
public static final Comparator COMPARATOR
public static final Comparator REVERSE_COMPARATOR
public static final Iterator EMPTY_ITERATOR
public static final Comparator<byte[]> BYTE_ARRAY_COMPARATOR
public static final Comparator<char[]> CHAR_ARRAY_COMPARATOR
public static final Comparator<int[]> INT_ARRAY_COMPARATOR
public static final Comparator<long[]> LONG_ARRAY_COMPARATOR
public static final Comparator<double[]> DOUBLE_ARRAY_COMPARATOR
public static final Comparator<Object[]> COMPARABLE_ARRAY_COMPARATOR
public static final Fun.RecordCondition RECORD_ALWAYS_TRUE
public static <T> Comparator<T> comparator()
COMPARATOR in order to insure type-safety
ex: Comparator<Integer> comparator = getComparator();public static <T> Comparator<T> reverseComparator()
comparator()).
Use this method instead of REVERSE_COMPARATOR in order to insure type-safety
ex: Comparator<Integer> comparator = getReversedComparator();public static <T> Iterator<T> emptyIterator()
public static boolean eq(Object a, Object b)
public static long roundUp(long number,
long roundUpToMultipleOf)
public static long roundDown(long number,
long roundDownToMultipleOf)
public static boolean arrayContains(long[] longs,
long val)
public static <K,V> Fun.Function1<K,Fun.Pair<K,V>> extractKey()
public static <K,V> Fun.Function1<V,Fun.Pair<K,V>> extractValue()
public static <K,V> Fun.Function1<K,Map.Entry<K,V>> extractMapEntryKey()
public static <K,V> Fun.Function1<V,Map.Entry<K,V>> extractMapEntryValue()
public static <K> Fun.Function1<K,K> extractNoTransform()
public static int compareInt(int x,
int y)
public static int compareLong(long x,
long y)
public static Iterable<Object[]> filter(NavigableSet<Object[]> set, Object... keys)
Bind.mapInverse(org.mapdb.Bind.MapWithModificationListener, java.util.Set)
and Bind.secondaryKey(org.mapdb.Bind.MapWithModificationListener, java.util.Set, org.mapdb.Fun.Function2)
It can by also used to find values from 'MultiMap'.set - Set or 'MultiMap' to find values inkeys - key to look fromsecondaryKeyCopyright © 2015. All Rights Reserved.