de.lmu.ifi.dbs.elki.properties
Class IterateKnownImplementations

java.lang.Object
  extended by de.lmu.ifi.dbs.elki.properties.IterateKnownImplementations
All Implemented Interfaces:
IterableIterator<Class<?>>, Iterable<Class<?>>, Iterator<Class<?>>

public class IterateKnownImplementations
extends Object
implements IterableIterator<Class<?>>

Iterator over all instanciable classes of a given superclass/interface. The list of "known" implementations is obtained via the ELKI properties mechanism.


Field Summary
(package private)  String[] classNames
          Class names array
private static Pattern COMMENTS
          Pattern to detect comments
(package private)  Class<?> cur
          Current class = next iterator value
(package private)  int index
          Index within the class names array
private static Logging logger
          Logger
(package private)  Class<?> superclass
          Super class
 
Constructor Summary
IterateKnownImplementations(Class<?> superclass)
          Constructor.
 
Method Summary
private  void findNext()
          Find the next 'acceptable' result.
 boolean hasNext()
          Return if there is a next known implementation
 Iterator<Class<?>> iterator()
          Adapter for Iterable interface for foreach statements
 Class<?> next()
          Advance the iterator, returning the 'next' result
 void remove()
          Removals are not supported by this iterator.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

private static final Logging logger
Logger


COMMENTS

private static final Pattern COMMENTS
Pattern to detect comments


cur

Class<?> cur
Current class = next iterator value


index

int index
Index within the class names array


classNames

String[] classNames
Class names array


superclass

Class<?> superclass
Super class

Constructor Detail

IterateKnownImplementations

public IterateKnownImplementations(Class<?> superclass)
Constructor.

Parameters:
superclass - Superclass to find implementations for.
Method Detail

findNext

private void findNext()
Find the next 'acceptable' result.


hasNext

public boolean hasNext()
Return if there is a next known implementation

Specified by:
hasNext in interface Iterator<Class<?>>

next

public Class<?> next()
Advance the iterator, returning the 'next' result

Specified by:
next in interface Iterator<Class<?>>

remove

public void remove()
            throws UnsupportedOperationException
Removals are not supported by this iterator.

Specified by:
remove in interface Iterator<Class<?>>
Throws:
UnsupportedOperationException - Not supported.

iterator

public Iterator<Class<?>> iterator()
Adapter for Iterable interface for foreach statements

Specified by:
iterator in interface Iterable<Class<?>>

Release 0.4.0 (2011-09-20_1324)