Package elki.database.ids
Interface ModifiableDBIDs
-
- All Superinterfaces:
DBIDs
- All Known Subinterfaces:
ArrayModifiableDBIDs,HashSetModifiableDBIDs
- All Known Implementing Classes:
ArrayModifiableIntegerDBIDs,FastutilIntOpenHashSetModifiableDBIDs
public interface ModifiableDBIDs extends DBIDs
Interface for a generic modifiable DBID collection.Note: we had this use the Java Collections API for a long time, however this prevented certain optimizations. So it now only mimics the Collections API deliberately.
- Since:
- 0.4.0
- Author:
- Erich Schubert
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleanadd(DBIDRef id)Add a single DBID to the collection.booleanaddDBIDs(DBIDs ids)Add DBIDs to collection.ModifiableDBIDsclear()Clear this collection.DBIDMIteriter()Get a modifiable DBID iterator (a more efficient API).DBIDVarpop(DBIDVar outvar)Pop (get and remove) one DBID from the set, into a variable.booleanremove(DBIDRef id)Remove a single DBID from the collection.booleanremoveDBIDs(DBIDs ids)Remove DBIDs from collection.
-
-
-
Method Detail
-
addDBIDs
boolean addDBIDs(DBIDs ids)
Add DBIDs to collection.- Parameters:
ids- IDs to add.- Returns:
trueif the collection changed.
-
removeDBIDs
boolean removeDBIDs(DBIDs ids)
Remove DBIDs from collection.- Parameters:
ids- IDs to remove.- Returns:
trueif the collection changed.
-
add
boolean add(DBIDRef id)
Add a single DBID to the collection.- Parameters:
id- ID to add- Returns:
trueif the collection changed.
-
remove
boolean remove(DBIDRef id)
Remove a single DBID from the collection.- Parameters:
id- ID to remove- Returns:
trueif the collection changed.
-
clear
ModifiableDBIDs clear()
Clear this collection.
-
iter
DBIDMIter iter()
Get a modifiable DBID iterator (a more efficient API).usage example:
for(DBIDMIter iter = ids.iter(); iter.valid(); iter.advance()) { DBID id = iter.getDBID(); iter.remove(); }
-
-