public final class Util extends Object
de.lmu.ifi.dbs.elki.utilities
Modifier and Type | Class and Description |
---|---|
private static class |
Util.ForwardComparator
Regular comparator.
|
Modifier and Type | Field and Description |
---|---|
private static Comparator<?> |
FORWARD
Static instance.
|
private static long |
HASHPRIME
Prime number used in hash code computation.
|
static boolean |
IS_JAVA7
Detect Java 7.
|
static boolean |
IS_ORACLE_JAVA
Detect Oracle Java.
|
Modifier | Constructor and Description |
---|---|
private |
Util()
Fake constructor: do not instantiate.
|
Modifier and Type | Method and Description |
---|---|
static <T> Comparator<T> |
forwardOrder()
Compare two objects, forward.
|
static int |
mixHashCodes(int... hash)
Mix multiple hashcodes into one.
|
static int |
mixHashCodes(int hash)
Deprecated.
|
static int |
mixHashCodes(int hash1,
int hash2)
Mix multiple hashcodes into one.
|
static int |
mixHashCodes(int hash1,
int hash2,
int hash3)
Mix multiple hashcodes into one.
|
static long[] |
randomBitSet(int cardinality,
int capacity,
Random random)
Creates a new BitSet of fixed cardinality with randomly set bits.
|
private static final long HASHPRIME
public static final boolean IS_JAVA7
public static final boolean IS_ORACLE_JAVA
private static final Comparator<?> FORWARD
public static long[] randomBitSet(int cardinality, int capacity, Random random)
cardinality
- the cardinality of the BitSet to createcapacity
- the capacity of the BitSet to create - the randomly
generated indices of the bits set to true will be uniformly
distributed between 0 (inclusive) and capacity (exclusive)random
- a Random Object to create the sequence of indices set to true
- the same number occurring twice or more is ignored but the already
selected bit remains true@Deprecated public static int mixHashCodes(int hash)
hash
- Single Hashcodes to "mix"public static int mixHashCodes(int hash1, int hash2)
hash1
- First hashcode to mixhash2
- Second hashcode to mixpublic static int mixHashCodes(int hash1, int hash2, int hash3)
hash1
- First hashcode to mixhash2
- Second hashcode to mixhash3
- Third hashcode to mixpublic static int mixHashCodes(int... hash)
hash
- Hashcodes to mixpublic static <T> Comparator<T> forwardOrder()
Collections.reverseOrder()
for a reverse comparator.T
- Object typeCopyright © 2015 ELKI Development Team, Lehr- und Forschungseinheit für Datenbanksysteme, Ludwig-Maximilians-Universität München. License information.