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
The base class for permutors of atom containers, with a single abstract
method
containerFromPermutation that should be implemented in
concrete derived classes.- Author:
- maclean
- Keywords:
- permutation
- Created on:
- 2009-09-09
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final IAtomContainerThe atom container that is permuted at each step. -
Constructor Summary
ConstructorsConstructorDescriptionAtomContainerPermutor(int size, IAtomContainer atomContainer) Start the permutor off with an initial atom container, and the size of the permutation. -
Method Summary
Modifier and TypeMethodDescriptionabstract IAtomContainercontainerFromPermutation(int[] permutation) Convert a permutation (expressed as a list of numbers) into a permuted atom container.next()Get a new container, but randomly skip forwards in the list of possible permutations to generate it.voidremove()Methods inherited from class Permutor
calculateMaxRank, getCurrentPermutation, getNextPermutation, getRandomNextPermutation, getRank, hasNext, setPermutation, setRankModifier and TypeMethodDescriptionintCalculate the max possible rank for permutations of N numbers.int[]Get the permutation that is currently being used.int[]Get the next permutation in the list.int[]Randomly skip ahead in the list of permutations.intgetRank()Get the current rank.booleanhasNext()voidsetPermutation(int[] permutation) Set the currently used permutation.voidsetRank(int rank) Set the permutation to use, given its rank.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Iterator
forEachRemaining, hasNext
-
Field Details
-
atomContainer
The atom container that is permuted at each step.
-
-
Constructor Details
-
AtomContainerPermutor
Start the permutor off with an initial atom container, and the size of the permutation.- Parameters:
atomContainer-
-
-
Method Details
-
containerFromPermutation
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
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
- Specified by:
nextin interfaceIterator<IAtomContainer>
-
remove
public void remove()- Specified by:
removein interfaceIterator<IAtomContainer>
-