de.lmu.ifi.dbs.elki.database.ids.integer
Class IntegerDBIDRange

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<DBID>
          extended by de.lmu.ifi.dbs.elki.database.ids.integer.IntegerDBIDRange
All Implemented Interfaces:
ArrayDBIDs, ArrayStaticDBIDs, DBIDRange, DBIDs, StaticDBIDs, Iterable<DBID>, Collection<DBID>, List<DBID>

 class IntegerDBIDRange
extends AbstractList<DBID>
implements DBIDRange

Representing a DBID range allocation


Nested Class Summary
protected  class IntegerDBIDRange.Itr
          Iterator class.
 
Field Summary
protected  int len
          Length value
protected  int start
          Start value
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
protected IntegerDBIDRange(int start, int len)
          Constructor.
 
Method Summary
 Collection<DBID> asCollection()
          Retrieve collection access to the IDs
 boolean contains(Object o)
          Test whether an ID is contained.
 DBID get(int i)
           
 int getOffset(DBID dbid)
          For storage array offsets.
 Iterator<DBID> iterator()
          Retrieve Iterator access to the IDs.
 int size()
          Retrieve the collection / data size.
<T> T[]
toArray(T[] a)
           
 
Methods inherited from class java.util.AbstractList
add, add, addAll, clear, equals, hashCode, indexOf, lastIndexOf, listIterator, listIterator, remove, removeRange, set, subList
 
Methods inherited from class java.util.AbstractCollection
addAll, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
add, add, addAll, addAll, clear, containsAll, equals, hashCode, indexOf, isEmpty, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, retainAll, set, subList, toArray
 
Methods inherited from interface de.lmu.ifi.dbs.elki.database.ids.DBIDs
isEmpty
 

Field Detail

start

protected final int start
Start value


len

protected final int len
Length value

Constructor Detail

IntegerDBIDRange

protected IntegerDBIDRange(int start,
                           int len)
Constructor.

Parameters:
start - Range start
len - Range length
Method Detail

size

public int size()
Description copied from interface: DBIDs
Retrieve the collection / data size.

Specified by:
size in interface DBIDs
Specified by:
size in interface Collection<DBID>
Specified by:
size in interface List<DBID>
Specified by:
size in class AbstractCollection<DBID>
Returns:
collection size

iterator

public Iterator<DBID> iterator()
Description copied from interface: DBIDs
Retrieve Iterator access to the IDs.

Specified by:
iterator in interface DBIDs
Specified by:
iterator in interface Iterable<DBID>
Specified by:
iterator in interface Collection<DBID>
Specified by:
iterator in interface List<DBID>
Overrides:
iterator in class AbstractList<DBID>
Returns:
an iterator for the IDs

contains

public boolean contains(Object o)
Description copied from interface: DBIDs
Test whether an ID is contained. Signature compatible with Collection.

Specified by:
contains in interface DBIDs
Specified by:
contains in interface Collection<DBID>
Specified by:
contains in interface List<DBID>
Overrides:
contains in class AbstractCollection<DBID>
Parameters:
o - object to test
Returns:
true when contained

toArray

public <T> T[] toArray(T[] a)
Specified by:
toArray in interface Collection<DBID>
Specified by:
toArray in interface List<DBID>
Overrides:
toArray in class AbstractCollection<DBID>

get

public DBID get(int i)
Specified by:
get in interface List<DBID>
Specified by:
get in class AbstractList<DBID>

getOffset

public int getOffset(DBID dbid)
For storage array offsets.

Specified by:
getOffset in interface DBIDRange
Parameters:
dbid -
Returns:
array offset

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

Release 0.4.0 (2011-09-20_1324)