de.lmu.ifi.dbs.elki.database.ids.generic
Class GenericHashSetModifiableDBIDs

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractSet<E>
          extended by java.util.HashSet<DBID>
              extended by de.lmu.ifi.dbs.elki.database.ids.generic.GenericHashSetModifiableDBIDs
All Implemented Interfaces:
DBIDs, HashSetDBIDs, HashSetModifiableDBIDs, ModifiableDBIDs, SetDBIDs, Serializable, Cloneable, Iterable<DBID>, Collection<DBID>, Set<DBID>

public class GenericHashSetModifiableDBIDs
extends HashSet<DBID>
implements HashSetModifiableDBIDs

Set-oriented implementation of a modifiable DBID collection. This should only be instantiated by a DBIDFactory! Use DBIDUtil.newHashSet()!

See Also:
Serialized Form

Field Summary
private static long serialVersionUID
          Serial version
 
Constructor Summary
GenericHashSetModifiableDBIDs()
          Constructor without extra hints
GenericHashSetModifiableDBIDs(DBIDs c)
          Constructor from existing DBIDs.
GenericHashSetModifiableDBIDs(int initialCapacity)
          Constructor with size hint.
 
Method Summary
 boolean addDBIDs(DBIDs ids)
          Add DBIDs to collection.
 Collection<DBID> asCollection()
          Retrieve collection access to the IDs
 boolean removeDBIDs(DBIDs ids)
          Remove DBIDs from collection.
 boolean retainAll(DBIDs ids)
          Retain all elements that also are in the second set.
 
Methods inherited from class java.util.HashSet
add, clear, clone, contains, isEmpty, iterator, remove, size
 
Methods inherited from class java.util.AbstractSet
equals, hashCode, removeAll
 
Methods inherited from class java.util.AbstractCollection
addAll, containsAll, retainAll, toArray, toArray, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface de.lmu.ifi.dbs.elki.database.ids.DBIDs
contains, isEmpty, size
 

Field Detail

serialVersionUID

private static final long serialVersionUID
Serial version

See Also:
Constant Field Values
Constructor Detail

GenericHashSetModifiableDBIDs

public GenericHashSetModifiableDBIDs(int initialCapacity)
Constructor with size hint.

Parameters:
initialCapacity - Size hint

GenericHashSetModifiableDBIDs

public GenericHashSetModifiableDBIDs()
Constructor without extra hints


GenericHashSetModifiableDBIDs

public GenericHashSetModifiableDBIDs(DBIDs c)
Constructor from existing DBIDs.

Parameters:
c - Existing DBIDs.
Method Detail

asCollection

public Collection<DBID> asCollection()
Description copied from interface: DBIDs
Retrieve collection access to the IDs

Specified by:
asCollection in interface DBIDs
Returns:
a collection of IDs

addDBIDs

public boolean addDBIDs(DBIDs ids)
Description copied from interface: ModifiableDBIDs
Add DBIDs to collection.

Specified by:
addDBIDs in interface ModifiableDBIDs
Parameters:
ids - IDs to add.
Returns:
true when modified

removeDBIDs

public boolean removeDBIDs(DBIDs ids)
Description copied from interface: ModifiableDBIDs
Remove DBIDs from collection.

Specified by:
removeDBIDs in interface ModifiableDBIDs
Parameters:
ids - IDs to remove.
Returns:
true when modified

retainAll

public boolean retainAll(DBIDs ids)
Description copied from interface: HashSetModifiableDBIDs
Retain all elements that also are in the second set.

Specified by:
retainAll in interface HashSetModifiableDBIDs
Parameters:
ids - second set
Returns:
true when modified

Release 0.4.0 (2011-09-20_1324)