org.molwind.chemical.io
Class SDFileIterator

java.lang.Object
  extended by org.molwind.chemical.io.SDFileIterator
All Implemented Interfaces:
java.util.Iterator

public class SDFileIterator
extends java.lang.Object
implements java.util.Iterator

SDFileIterator reads sdf formatted files of chemical compounds.

Version:
1.0
Author:
Oliver Karch

Constructor Summary
SDFileIterator(java.io.File[] theFiles, RelationshipResolver resolver)
          Creates a new chemical entity iterator based on the underlying SD files using the given relationship resolver.
 
Method Summary
 DefaultEntityGraph getDefaultEntityGraph()
          Returns the Graph for the given file
 boolean hasNext()
          Returns true if the iteration has more elements.
 java.lang.Object next()
          Returns the next element in the iteration.
 void remove()
          Removes from the underlying collection the last element returned by the iterator.
 void setFileReader(java.io.File f)
          Sets the file reader
 void setFileReader(java.lang.String name)
          Sets the file reader
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SDFileIterator

public SDFileIterator(java.io.File[] theFiles,
                      RelationshipResolver resolver)
Creates a new chemical entity iterator based on the underlying SD files using the given relationship resolver.

Parameters:
theFiles - array of one or more file
resolver - the relationship resolver strategy
Method Detail

setFileReader

public void setFileReader(java.io.File f)
                   throws java.io.IOException
Sets the file reader

Parameters:
the - file to be read
Throws:
java.io.IOException

setFileReader

public void setFileReader(java.lang.String name)
Sets the file reader

Parameters:
the - filename of the file to be read

getDefaultEntityGraph

public DefaultEntityGraph getDefaultEntityGraph()
                                         throws java.io.IOException
Returns the Graph for the given file

Returns:
an object from DefaultEntityGraph
Throws:
java.io.IOException

hasNext

public boolean hasNext()
Returns true if the iteration has more elements.

Specified by:
hasNext in interface java.util.Iterator
Returns:
true if the iterator has more elements

next

public java.lang.Object next()
Returns the next element in the iteration.

Specified by:
next in interface java.util.Iterator
Returns:
the next element in the iteration

remove

public void remove()
Removes from the underlying collection the last element returned by the iterator. This operation is not supported.

Specified by:
remove in interface java.util.Iterator


Copyright © 2008-2010. All Rights Reserved.