|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.lmu.ifi.dbs.elki.database.ids.DBIDUtil
public final class DBIDUtil
DBID Utility functions.
Field Summary | |
---|---|
static EmptyDBIDs |
EMPTYDBIDS
Final, global copy of empty DBIDs. |
Constructor Summary | |
---|---|
private |
DBIDUtil()
Static - no public constructor. |
Method Summary | |
---|---|
static void |
deallocateDBIDRange(DBIDRange range)
Deallocate a static DBID range. |
static void |
deallocateSingleDBID(DBID id)
Return a single DBID for reuse. |
static ModifiableDBIDs |
difference(DBIDs ids1,
DBIDs ids2)
Returns the difference of the two specified collection of IDs. |
static ArrayDBIDs |
ensureArray(DBIDs ids)
Ensure that the given DBIDs are array-indexable. |
static ModifiableDBIDs |
ensureModifiable(DBIDs ids)
Ensure modifiable |
static SetDBIDs |
ensureSet(DBIDs ids)
Ensure that the given DBIDs support fast "contains" operations. |
static DBID |
generateSingleDBID()
Generate a single DBID |
static DBIDRange |
generateStaticDBIDRange(int size)
Generate a static DBID range. |
ByteBufferSerializer<DBID> |
getDBIDSerializer()
Get a serializer for DBIDs |
ByteBufferSerializer<DBID> |
getDBIDSerializerStatic()
Get a serializer for DBIDs with static size |
static DBID |
importInteger(int id)
Import an Integer DBID. |
static ModifiableDBIDs |
intersection(DBIDs first,
DBIDs second)
Compute the set intersection of two sets. |
static StaticDBIDs |
makeUnmodifiable(DBIDs existing)
Wrap an existing DBIDs collection to be unmodifiable. |
static ArrayModifiableDBIDs |
newArray()
Make a new (modifiable) array of DBIDs. |
static ArrayModifiableDBIDs |
newArray(DBIDs existing)
Make a new (modifiable) array of DBIDs. |
static ArrayModifiableDBIDs |
newArray(int size)
Make a new (modifiable) array of DBIDs. |
static HashSetModifiableDBIDs |
newHashSet()
Make a new (modifiable) hash set of DBIDs. |
static HashSetModifiableDBIDs |
newHashSet(DBIDs existing)
Make a new (modifiable) hash set of DBIDs. |
static HashSetModifiableDBIDs |
newHashSet(int size)
Make a new (modifiable) hash set of DBIDs. |
static DBIDPair |
newPair(DBID id1,
DBID id2)
Make a DBID pair. |
static TreeSetModifiableDBIDs |
newTreeSet()
Make a new (modifiable) tree set of DBIDs. |
static TreeSetModifiableDBIDs |
newTreeSet(DBIDs existing)
Make a new (modifiable) tree set of DBIDs. |
static TreeSetModifiableDBIDs |
newTreeSet(int size)
Make a new (modifiable) tree set of DBIDs. |
static ModifiableDBIDs |
randomSample(DBIDs source,
int k,
long seed)
Produce a random sample of the given DBIDs |
static ModifiableDBIDs |
union(DBIDs ids1,
DBIDs ids2)
Returns the union of the two specified collection of IDs. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final EmptyDBIDs EMPTYDBIDS
Constructor Detail |
---|
private DBIDUtil()
Method Detail |
---|
public static DBID importInteger(int id)
id
- Integer ID
public ByteBufferSerializer<DBID> getDBIDSerializer()
public ByteBufferSerializer<DBID> getDBIDSerializerStatic()
public static DBID generateSingleDBID()
public static void deallocateSingleDBID(DBID id)
id
- DBID to deallocatepublic static DBIDRange generateStaticDBIDRange(int size)
size
- Requested size
public static void deallocateDBIDRange(DBIDRange range)
range
- Range to deallocatepublic static ArrayModifiableDBIDs newArray()
public static HashSetModifiableDBIDs newHashSet()
public static TreeSetModifiableDBIDs newTreeSet()
public static ArrayModifiableDBIDs newArray(int size)
size
- Size hint
public static HashSetModifiableDBIDs newHashSet(int size)
size
- Size hint
public static TreeSetModifiableDBIDs newTreeSet(int size)
size
- Size hint
public static ArrayModifiableDBIDs newArray(DBIDs existing)
existing
- Existing DBIDs
public static HashSetModifiableDBIDs newHashSet(DBIDs existing)
existing
- Existing DBIDs
public static TreeSetModifiableDBIDs newTreeSet(DBIDs existing)
existing
- Existing DBIDs
public static ModifiableDBIDs intersection(DBIDs first, DBIDs second)
first
- First setsecond
- Second set
public static ModifiableDBIDs union(DBIDs ids1, DBIDs ids2)
ids1
- the first collectionids2
- the second collection
public static ModifiableDBIDs difference(DBIDs ids1, DBIDs ids2)
ids1
- the first collectionids2
- the second collection
public static StaticDBIDs makeUnmodifiable(DBIDs existing)
existing
- Existing collection
public static ArrayDBIDs ensureArray(DBIDs ids)
ids
-
public static SetDBIDs ensureSet(DBIDs ids)
ids
-
public static ModifiableDBIDs ensureModifiable(DBIDs ids)
ids
-
public static DBIDPair newPair(DBID id1, DBID id2)
id1
- first IDid2
- second ID
public static ModifiableDBIDs randomSample(DBIDs source, int k, long seed)
source
- Original DBIDsk
- k Parameterseed
- Random generator seed
|
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |