chemaxon.util.iterator
Class IteratorFactory.NeighbourIterator<E>

java.lang.Object
  extended by chemaxon.util.iterator.IteratorFactory.NeighbourIterator<E>
All Implemented Interfaces:
Iterator<E>
Direct Known Subclasses:
IteratorFactory.AtomNeighbourIterator, IteratorFactory.BondNeighbourIterator
Enclosing class:
IteratorFactory

public abstract class IteratorFactory.NeighbourIterator<E>
extends Object
implements Iterator<E>

The NeighbourIterator class provides an iterator to process the bonds connecting to the specified atom according to the atom and bond related behavior of this factory.


Field Summary
protected  MolAtom atom
          The atom whose the neighbours are processed.
protected  int currentBond
          Current bond pointer of the iterator.
protected  List<MolBond> secondaryBonds
          Secondary bonds that replace a coordinate bond to the multicenter with coordinate bonds from the metal to the represented atoms (in the MulticenterSgroup of the multicenter).
 
Constructor Summary
IteratorFactory.NeighbourIterator(MolAtom atom)
          Constructs an iterator to process the bonds connecting to the specified atom.
 
Method Summary
protected  MolBond getBond(int index)
          Returns a bond of a specified index.
 boolean hasNext()
          Decides whether the iteration has more element.
protected  int nextBondIndex(int index)
          Returns the next bond index in the iteration according to the atom and bond related behavior specified in the factory.
 void remove()
          The remove operation is not supported by this Iterator implementation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Iterator
next
 

Field Detail

atom

protected MolAtom atom
The atom whose the neighbours are processed.


currentBond

protected int currentBond
Current bond pointer of the iterator.


secondaryBonds

protected List<MolBond> secondaryBonds
Secondary bonds that replace a coordinate bond to the multicenter with coordinate bonds from the metal to the represented atoms (in the MulticenterSgroup of the multicenter). These secondary bonds are not added to the molecule of the factory, so do not use Molecule.indexOf for the secondary bonds! In the future, secondary bonds may be implemented for other types of connections too.

Constructor Detail

IteratorFactory.NeighbourIterator

public IteratorFactory.NeighbourIterator(MolAtom atom)
Constructs an iterator to process the bonds connecting to the specified atom. The following bonds are excluded:

Parameters:
atom - the atom whose bonds to be iterated
Method Detail

getBond

protected MolBond getBond(int index)
Returns a bond of a specified index.

Parameters:
index - the specified index of the bond
Returns:
the bond of the specified index

hasNext

public boolean hasNext()
Decides whether the iteration has more element.

Specified by:
hasNext in interface Iterator<E>
Returns:
true if the iteration has more element, false otherwise.

nextBondIndex

protected int nextBondIndex(int index)
Returns the next bond index in the iteration according to the atom and bond related behavior specified in the factory.

Parameters:
index - the current index to get the subsequent index from
Returns:
the subsequent index

remove

public void remove()
The remove operation is not supported by this Iterator implementation.

Specified by:
remove in interface Iterator<E>
Throws:
UnsupportedOperationException
See Also:
Iterator.remove()