Package org.openscience.cdk.graph
Class AtomContainerPermutor
- java.lang.Object
-
- org.openscience.cdk.graph.Permutor
-
- org.openscience.cdk.graph.AtomContainerPermutor
-
- All Implemented Interfaces:
Iterator<IAtomContainer>
- Direct Known Subclasses:
AtomContainerAtomPermutor
,AtomContainerBondPermutor
public abstract class AtomContainerPermutor extends Permutor implements Iterator<IAtomContainer>
The base class for permutors of atom containers, with a single abstract methodcontainerFromPermutation
that should be implemented in concrete derived classes.- Author:
- maclean
- Source code:
- main
- Belongs to CDK module:
- standard
- Keywords:
- permutation
- Created on:
- 2009-09-09
-
-
Field Summary
Fields Modifier and Type Field Description protected IAtomContainer
atomContainer
The atom container that is permuted at each step.
-
Constructor Summary
Constructors Constructor Description AtomContainerPermutor(int size, IAtomContainer atomContainer)
Start the permutor off with an initial atom container, and the size of the permutation.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract IAtomContainer
containerFromPermutation(int[] permutation)
Convert a permutation (expressed as a list of numbers) into a permuted atom container.IAtomContainer
next()
IAtomContainer
randomNext()
Get a new container, but randomly skip forwards in the list of possible permutations to generate it.void
remove()
-
Methods inherited from class org.openscience.cdk.graph.Permutor
calculateMaxRank, getCurrentPermutation, getNextPermutation, getRandomNextPermutation, getRank, hasNext, setPermutation, setRank
-
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
forEachRemaining, hasNext
-
-
-
-
Field Detail
-
atomContainer
protected final IAtomContainer atomContainer
The atom container that is permuted at each step.
-
-
Constructor Detail
-
AtomContainerPermutor
public AtomContainerPermutor(int size, IAtomContainer atomContainer)
Start the permutor off with an initial atom container, and the size of the permutation.- Parameters:
atomContainer
-
-
-
Method Detail
-
containerFromPermutation
public abstract IAtomContainer containerFromPermutation(int[] permutation)
Convert a permutation (expressed as a list of numbers) into a permuted atom container. This will differ depending on the desired effect of the permutation (atoms or bonds, for example).- Returns:
- the atom container corresponding to this permutation
-
randomNext
public IAtomContainer randomNext()
Get a new container, but randomly skip forwards in the list of possible permutations to generate it.- Returns:
- a random next permuted atom container
-
next
public IAtomContainer next()
- Specified by:
next
in interfaceIterator<IAtomContainer>
-
remove
public void remove()
- Specified by:
remove
in interfaceIterator<IAtomContainer>
-
-