public class AtomContainerSet extends ChemObject implements Serializable, IAtomContainerSet, IChemObjectListener, Cloneable
| Modifier and Type | Field and Description |
|---|---|
protected int |
atomContainerCount
Number of AtomContainers contained by this container.
|
protected IAtomContainer[] |
atomContainers
Array of AtomContainers.
|
protected int |
growArraySize
Amount by which the AtomContainers array grows when elements are added and
the array is not large enough for that.
|
protected Double[] |
multipliers
Defines the number of instances of a certain molecule
in the set.
|
| Constructor and Description |
|---|
AtomContainerSet()
Constructs an empty AtomContainerSet.
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(IAtomContainerSet atomContainerSet)
Adds all atomContainers in the AtomContainerSet to this container.
|
void |
addAtomContainer(IAtomContainer atomContainer)
Adds an atomContainer to this container.
|
void |
addAtomContainer(IAtomContainer atomContainer,
double multiplier)
Adds an atomContainer to this container with the given
multiplier.
|
Iterable<IAtomContainer> |
atomContainers()
Get an iterator for this AtomContainerSet.
|
Object |
clone()
Clones this AtomContainerSet and its content.
|
IAtomContainer |
getAtomContainer(int number)
Returns the AtomContainer at position
number in the
container. |
int |
getAtomContainerCount()
Returns the number of AtomContainers in this Container.
|
Double |
getMultiplier(IAtomContainer container)
Returns the multiplier of the given AtomContainer.
|
Double |
getMultiplier(int number)
Returns the multiplier for the AtomContainer at position
number in the
container. |
Double[] |
getMultipliers()
Returns an array of double with the stoichiometric coefficients
of the products.
|
protected void |
growAtomContainerArray()
Grows the atomContainer array by a given size.
|
boolean |
isEmpty()
Returns true if this IAtomContainerSet is empty.
|
void |
removeAllAtomContainers()
Removes all AtomContainer from this container.
|
void |
removeAtomContainer(IAtomContainer atomContainer)
Removes an AtomContainer from this container.
|
void |
removeAtomContainer(int pos)
Removes an AtomContainer from this container.
|
void |
replaceAtomContainer(int position,
IAtomContainer container)
Replace the AtomContainer at a specific position (array has to be large enough).
|
boolean |
setMultiplier(IAtomContainer container,
Double multiplier)
Sets the coefficient of a AtomContainer to a given value.
|
void |
setMultiplier(int position,
Double multiplier)
Sets the coefficient of a AtomContainer to a given value.
|
boolean |
setMultipliers(Double[] newMultipliers)
Sets the multipliers of the AtomContainers.
|
void |
sortAtomContainers(Comparator<IAtomContainer> comparator)
Sort the AtomContainers and multipliers using a provided Comparator
|
void |
stateChanged(IChemObjectChangeEvent event)
Called by objects to which this object has
registered as a listener.
|
String |
toString()
Returns the String representation of this AtomContainerSet.
|
addListener, addProperties, compare, getBuilder, getFlag, getFlags, getFlagValue, getID, getListenerCount, getNotification, getProperties, getProperty, getProperty, notifyChanged, notifyChanged, removeListener, removeProperty, setFlag, setFlags, setID, setNotification, setProperties, setProperty, shallowCopyequals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitaddListener, addProperties, getFlag, getFlags, getFlagValue, getID, getListenerCount, getNotification, getProperties, getProperty, getProperty, notifyChanged, notifyChanged, removeListener, removeProperty, setFlag, setFlags, setID, setNotification, setProperties, setPropertygetBuilderprotected IAtomContainer[] atomContainers
protected int atomContainerCount
protected Double[] multipliers
protected int growArraySize
public void addAtomContainer(IAtomContainer atomContainer)
addAtomContainer in interface IAtomContainerSetatomContainer - The atomContainer to be added to this containerpublic void removeAtomContainer(IAtomContainer atomContainer)
removeAtomContainer in interface IAtomContainerSetatomContainer - The atomContainer to be removed from this containerpublic void removeAllAtomContainers()
removeAllAtomContainers in interface IAtomContainerSetpublic void removeAtomContainer(int pos)
removeAtomContainer in interface IAtomContainerSetpos - The position of the AtomContainer to be removed from this containerpublic void replaceAtomContainer(int position,
IAtomContainer container)
replaceAtomContainer in interface IAtomContainerSetposition - position in array for AtomContainercontainer - the replacement AtomContainerpublic boolean setMultiplier(IAtomContainer container, Double multiplier)
setMultiplier in interface IAtomContainerSetcontainer - The AtomContainer for which the multiplier is setmultiplier - The new multiplier for the AtomContatinergetMultiplier(IAtomContainer)public void setMultiplier(int position,
Double multiplier)
setMultiplier in interface IAtomContainerSetposition - The position of the AtomContainer for which the multiplier is
set in [0,..]multiplier - The new multiplier for the AtomContatiner at
positiongetMultiplier(int)public Double[] getMultipliers()
getMultipliers in interface IAtomContainerSetsetMultipliers(java.lang.Double[])public boolean setMultipliers(Double[] newMultipliers)
setMultipliers in interface IAtomContainerSetnewMultipliers - The new multipliers for the AtomContainers in this setgetMultipliers()public void addAtomContainer(IAtomContainer atomContainer, double multiplier)
addAtomContainer in interface IAtomContainerSetatomContainer - The atomContainer to be added to this containermultiplier - The multiplier of this atomContainerpublic void add(IAtomContainerSet atomContainerSet)
add in interface IAtomContainerSetatomContainerSet - The AtomContainerSetpublic Iterable<IAtomContainer> atomContainers()
atomContainers in interface IAtomContainerSetpublic IAtomContainer getAtomContainer(int number)
number in the
container.getAtomContainer in interface IAtomContainerSetnumber - The position of the AtomContainer to be returned.number .public Double getMultiplier(int number)
number in the
container.getMultiplier in interface IAtomContainerSetnumber - The position of the multiplier of the AtomContainer to be returned.number .setMultiplier(int, Double)public Double getMultiplier(IAtomContainer container)
getMultiplier in interface IAtomContainerSetcontainer - The AtomContainer for which the multiplier is givensetMultiplier(IAtomContainer, Double)protected void growAtomContainerArray()
growArraySizepublic int getAtomContainerCount()
getAtomContainerCount in interface IAtomContainerSetpublic String toString()
toString in interface IChemObjecttoString in class Objectpublic Object clone() throws CloneNotSupportedException
clone in interface IChemObjectclone in class ChemObjectCloneNotSupportedException - if the IChemObject cannot be clonedpublic void stateChanged(IChemObjectChangeEvent event)
stateChanged in interface IChemObjectListenerevent - A change event pointing to the source of the changepublic void sortAtomContainers(Comparator<IAtomContainer> comparator)
sortAtomContainers in interface IAtomContainerSetcomparator - defines the sorting methodpublic boolean isEmpty()
isEmpty in interface IAtomContainerSetCopyright © 2022. All rights reserved.