diff options
Diffstat (limited to 'elki/src/main/java/de/lmu/ifi/dbs/elki/database/ids/ModifiableDBIDs.java')
-rw-r--r-- | elki/src/main/java/de/lmu/ifi/dbs/elki/database/ids/ModifiableDBIDs.java | 31 |
1 files changed, 18 insertions, 13 deletions
diff --git a/elki/src/main/java/de/lmu/ifi/dbs/elki/database/ids/ModifiableDBIDs.java b/elki/src/main/java/de/lmu/ifi/dbs/elki/database/ids/ModifiableDBIDs.java index fa88c373..f59f1d92 100644 --- a/elki/src/main/java/de/lmu/ifi/dbs/elki/database/ids/ModifiableDBIDs.java +++ b/elki/src/main/java/de/lmu/ifi/dbs/elki/database/ids/ModifiableDBIDs.java @@ -25,43 +25,46 @@ package de.lmu.ifi.dbs.elki.database.ids; /** * 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 * <em>deliberately</em>. - * + * * @author Erich Schubert - * + * @since 0.4.0 + * * @apiviz.has DBIDMIter */ public interface ModifiableDBIDs extends DBIDs { /** * Add DBIDs to collection. - * + * * @param ids IDs to add. - * @return {@code true} when modified + * @return {@code true} if the collection changed. */ boolean addDBIDs(DBIDs ids); /** * Remove DBIDs from collection. - * + * * @param ids IDs to remove. - * @return {@code true} when modified + * @return {@code true} if the collection changed. */ boolean removeDBIDs(DBIDs ids); /** * Add a single DBID to the collection. - * + * * @param id ID to add + * @return {@code true} if the collection changed. */ boolean add(DBIDRef id); /** * Remove a single DBID from the collection. - * + * * @param id ID to remove + * @return {@code true} if the collection changed. */ boolean remove(DBIDRef id); @@ -72,9 +75,9 @@ public interface ModifiableDBIDs extends DBIDs { /** * Get a <em>modifiable</em> DBID iterator (a more efficient API). - * + * * usage example: - * + * * <pre> * {@code * for(DBIDMIter iter = ids.iter(); iter.valid(); iter.advance()) { @@ -83,7 +86,7 @@ public interface ModifiableDBIDs extends DBIDs { * } * } * </pre> - * + * * @return modifiable iterator */ @Override @@ -93,6 +96,8 @@ public interface ModifiableDBIDs extends DBIDs { * Pop (get and remove) one DBID from the set, into a variable. * * @param outvar Output variable + * @return Always {@code outvar}, for inlining + * @throws ArrayIndexOutOfBoundsException when empty. */ - void pop(DBIDVar outvar); + DBIDVar pop(DBIDVar outvar); }
\ No newline at end of file |