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 boolean
add(DBIDRef id)
Add a single DBID to the collection.boolean
addDBIDs(DBIDs ids)
Add DBIDs to collection.ModifiableDBIDs
clear()
Clear this collection.DBIDMIter
iter()
Get a modifiable DBID iterator (a more efficient API).DBIDVar
pop(DBIDVar outvar)
Pop (get and remove) one DBID from the set, into a variable.boolean
remove(DBIDRef id)
Remove a single DBID from the collection.boolean
removeDBIDs(DBIDs ids)
Remove DBIDs from collection.
-
-
-
Method Detail
-
addDBIDs
boolean addDBIDs(DBIDs ids)
Add DBIDs to collection.- Parameters:
ids
- IDs to add.- Returns:
true
if the collection changed.
-
removeDBIDs
boolean removeDBIDs(DBIDs ids)
Remove DBIDs from collection.- Parameters:
ids
- IDs to remove.- Returns:
true
if the collection changed.
-
add
boolean add(DBIDRef id)
Add a single DBID to the collection.- Parameters:
id
- ID to add- Returns:
true
if the collection changed.
-
remove
boolean remove(DBIDRef id)
Remove a single DBID from the collection.- Parameters:
id
- ID to remove- Returns:
true
if 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(); }
-
-