Package elki.database.ids.integer
Class FastutilIntOpenHashSetModifiableDBIDs
- java.lang.Object
-
- elki.database.ids.integer.FastutilIntOpenHashSetModifiableDBIDs
-
- All Implemented Interfaces:
DBIDs,HashSetDBIDs,HashSetModifiableDBIDs,IntegerDBIDs,ModifiableDBIDs,SetDBIDs
class FastutilIntOpenHashSetModifiableDBIDs extends java.lang.Object implements HashSetModifiableDBIDs, IntegerDBIDs
Implementation using Fastutil IntSet.- Since:
- 0.5.0
- Author:
- Erich Schubert
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classFastutilIntOpenHashSetModifiableDBIDs.IntOpenHashSetCustomized table.protected static classFastutilIntOpenHashSetModifiableDBIDs.ItrIterator over Fastutil hashs.
-
Field Summary
Fields Modifier and Type Field Description (package private) FastutilIntOpenHashSetModifiableDBIDs.IntOpenHashSetstoreThe actual store.
-
Constructor Summary
Constructors Modifier Constructor Description protectedFastutilIntOpenHashSetModifiableDBIDs()Constructor.protectedFastutilIntOpenHashSetModifiableDBIDs(int size)Constructor.protectedFastutilIntOpenHashSetModifiableDBIDs(DBIDs existing)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanadd(DBIDRef e)Add a single DBID to the collection.booleanaddDBIDs(DBIDs ids)Add DBIDs to collection.FastutilIntOpenHashSetModifiableDBIDsclear()Clear this collection.booleancontains(DBIDRef o)Test whether an ID is contained.booleanisEmpty()Test for an empty DBID collection.FastutilIntOpenHashSetModifiableDBIDs.Itriter()Get a DBID iterator (a more efficient API).DBIDVarpop(DBIDVar outvar)Pop (get and remove) one DBID from the set, into a variable.booleanremove(DBIDRef o)Remove a single DBID from the collection.booleanremoveDBIDs(DBIDs ids)Remove DBIDs from collection.booleanretainAll(DBIDs set)Retain all elements that also are in the second set.intsize()Retrieve the collection / data size.java.lang.StringtoString()
-
-
-
Field Detail
-
store
FastutilIntOpenHashSetModifiableDBIDs.IntOpenHashSet store
The actual store.
-
-
Constructor Detail
-
FastutilIntOpenHashSetModifiableDBIDs
protected FastutilIntOpenHashSetModifiableDBIDs(int size)
Constructor.- Parameters:
size- Initial size
-
FastutilIntOpenHashSetModifiableDBIDs
protected FastutilIntOpenHashSetModifiableDBIDs()
Constructor.
-
FastutilIntOpenHashSetModifiableDBIDs
protected FastutilIntOpenHashSetModifiableDBIDs(DBIDs existing)
Constructor.- Parameters:
existing- Existing IDs
-
-
Method Detail
-
iter
public FastutilIntOpenHashSetModifiableDBIDs.Itr iter()
Description copied from interface:DBIDsGet a DBID iterator (a more efficient API).Example:
for(DBIDIter iter = ids.iter(); iter.valid(); iter.advance()) { NumberVector vec = relation.get(iter); // iter is a temporary object reference }- Specified by:
iterin interfaceDBIDs- Specified by:
iterin interfaceHashSetModifiableDBIDs- Specified by:
iterin interfaceIntegerDBIDs- Specified by:
iterin interfaceModifiableDBIDs- Returns:
- iterator
-
addDBIDs
public boolean addDBIDs(DBIDs ids)
Description copied from interface:ModifiableDBIDsAdd DBIDs to collection.- Specified by:
addDBIDsin interfaceModifiableDBIDs- Parameters:
ids- IDs to add.- Returns:
trueif the collection changed.
-
removeDBIDs
public boolean removeDBIDs(DBIDs ids)
Description copied from interface:ModifiableDBIDsRemove DBIDs from collection.- Specified by:
removeDBIDsin interfaceModifiableDBIDs- Parameters:
ids- IDs to remove.- Returns:
trueif the collection changed.
-
add
public boolean add(DBIDRef e)
Description copied from interface:ModifiableDBIDsAdd a single DBID to the collection.- Specified by:
addin interfaceModifiableDBIDs- Parameters:
e- ID to add- Returns:
trueif the collection changed.
-
remove
public boolean remove(DBIDRef o)
Description copied from interface:ModifiableDBIDsRemove a single DBID from the collection.- Specified by:
removein interfaceModifiableDBIDs- Parameters:
o- ID to remove- Returns:
trueif the collection changed.
-
retainAll
public boolean retainAll(DBIDs set)
Description copied from interface:HashSetModifiableDBIDsRetain all elements that also are in the second set.- Specified by:
retainAllin interfaceHashSetModifiableDBIDs- Parameters:
set- second set- Returns:
- true when modified
-
size
public int size()
Description copied from interface:DBIDsRetrieve the collection / data size.
-
isEmpty
public boolean isEmpty()
Description copied from interface:DBIDsTest for an empty DBID collection.
-
clear
public FastutilIntOpenHashSetModifiableDBIDs clear()
Description copied from interface:ModifiableDBIDsClear this collection.- Specified by:
clearin interfaceHashSetModifiableDBIDs- Specified by:
clearin interfaceModifiableDBIDs
-
contains
public boolean contains(DBIDRef o)
Description copied from interface:DBIDsTest whether an ID is contained.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
pop
public DBIDVar pop(DBIDVar outvar)
Description copied from interface:ModifiableDBIDsPop (get and remove) one DBID from the set, into a variable.- Specified by:
popin interfaceModifiableDBIDs- Parameters:
outvar- Output variable- Returns:
- Always
outvar, for inlining
-
-