Environment for
DeveLoping
KDD-Applications
Supported by Index-Structures

de.lmu.ifi.dbs.elki.data
Class DatabaseObjectGroupArray

java.lang.Object
  extended by de.lmu.ifi.dbs.elki.data.DatabaseObjectGroupArray
All Implemented Interfaces:
DatabaseObjectGroup, Iterable<Integer>

public final class DatabaseObjectGroupArray
extends Object
implements DatabaseObjectGroup

Array backed DatabaseObjectGroup. Stores a list of DatabaseObjectIDs using an array of Integer[].

Author:
Erich Schubert

Field Summary
 Integer[] ids
          ID storage.
 
Constructor Summary
DatabaseObjectGroupArray(Integer[] ids)
          Constructor.
 
Method Summary
 Collection<Integer> getIDs()
          Retrieve the IDs as collection.
 Iterator<Integer> iterator()
          Return an iterator over the array.
 int size()
          Return the backing array length.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ids

public Integer[] ids
ID storage.

Constructor Detail

DatabaseObjectGroupArray

public DatabaseObjectGroupArray(Integer[] ids)
Constructor.

Parameters:
ids -
Method Detail

getIDs

public Collection<Integer> getIDs()
Retrieve the IDs as collection. Note that for array backed groups this will generate a copy.

Specified by:
getIDs in interface DatabaseObjectGroup
Returns:
a collection of IDs

iterator

public Iterator<Integer> iterator()
Return an iterator over the array.

Specified by:
iterator in interface DatabaseObjectGroup
Specified by:
iterator in interface Iterable<Integer>
Returns:
an iterator for the IDs

size

public int size()
Return the backing array length.

Specified by:
size in interface DatabaseObjectGroup
Returns:
collection size

Release 0.2.1 (2009-07-13_1605)