Package org.openscience.cdk
Class Association
- java.lang.Object
-
- org.openscience.cdk.ChemObject
-
- org.openscience.cdk.ElectronContainer
-
- org.openscience.cdk.Association
-
- All Implemented Interfaces:
Serializable
,Cloneable
,ICDKObject
,IChemObject
,IElectronContainer
public class Association extends ElectronContainer implements Serializable, Cloneable
Base class for storing interactions like hydrogen bonds and ionic interactions. The ElectronContainer contains zero electrons by default.- See Also:
- Serialized Form
- Source code:
- main
- Belongs to CDK module:
- extra
- Keywords:
- orbital, association, bond
-
-
Field Summary
Fields Modifier and Type Field Description protected int
atomCount
protected IAtom[]
atoms
The atoms which take part in the association.protected int
electronCount
Number of electrons in the association.
-
Constructor Summary
Constructors Constructor Description Association()
Constructs an empty association.Association(IAtom atom1, IAtom atom2)
Constructs an association between two Atom's.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
contains(IAtom atom)
Returns true if the given atom participates in this Association.IAtom
getAtomAt(int position)
Returns an Atom from this Association.int
getAtomCount()
Returns the number of Atoms in this Association.IAtom[]
getAtoms()
Returns the array of atoms making up this Association.Integer
getElectronCount()
Returns the number of electrons in a Association.void
setAtomAt(IAtom atom, int position)
Sets an Atom in this Association.void
setAtoms(IAtom[] atoms)
Sets the array of atoms making up this Association.String
toString()
Returns a one line string representation of this Container.-
Methods inherited from class org.openscience.cdk.ElectronContainer
clone, setElectronCount
-
Methods inherited from class org.openscience.cdk.ChemObject
addListener, addProperties, compare, getBuilder, getFlag, getFlags, getFlagValue, getID, getListenerCount, getNotification, getProperties, getProperty, getProperty, notifyChanged, notifyChanged, removeListener, removeProperty, setFlag, setFlags, setID, setNotification, setProperties, setProperty, shallowCopy
-
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.openscience.cdk.interfaces.ICDKObject
getBuilder
-
Methods inherited from interface org.openscience.cdk.interfaces.IChemObject
addListener, addProperties, getFlag, getFlags, getFlagValue, getID, getListenerCount, getNotification, getProperties, getProperty, getProperty, notifyChanged, notifyChanged, removeListener, removeProperty, setFlag, setFlags, setID, setNotification, setProperties, setProperty
-
-
-
-
Field Detail
-
electronCount
protected final int electronCount
Number of electrons in the association.- See Also:
- Constant Field Values
-
atoms
protected IAtom[] atoms
The atoms which take part in the association.
-
atomCount
protected int atomCount
-
-
Constructor Detail
-
Association
public Association(IAtom atom1, IAtom atom2)
Constructs an association between two Atom's.- Parameters:
atom1
- An atom to be associated with another atomatom2
- An atom to be associated with another atom- See Also:
Atom
-
Association
public Association()
Constructs an empty association.- See Also:
Atom
-
-
Method Detail
-
getAtoms
public IAtom[] getAtoms()
Returns the array of atoms making up this Association.- Returns:
- An array of atoms participating in this Association
- See Also:
setAtoms(org.openscience.cdk.interfaces.IAtom[])
-
setAtoms
public void setAtoms(IAtom[] atoms)
Sets the array of atoms making up this Association.- Parameters:
atoms
- An array of atoms that forms this Association- See Also:
getAtoms()
-
getAtomCount
public int getAtomCount()
Returns the number of Atoms in this Association.- Returns:
- The number of Atoms in this Association
-
getElectronCount
public Integer getElectronCount()
Returns the number of electrons in a Association.- Specified by:
getElectronCount
in interfaceIElectronContainer
- Overrides:
getElectronCount
in classElectronContainer
- Returns:
- The number of electrons in a Association.
- See Also:
ElectronContainer.setElectronCount(java.lang.Integer)
-
getAtomAt
public IAtom getAtomAt(int position)
Returns an Atom from this Association.- Parameters:
position
- The position in this bond where the atom is- Returns:
- The atom at the specified position
- See Also:
setAtomAt(org.openscience.cdk.interfaces.IAtom, int)
-
contains
public boolean contains(IAtom atom)
Returns true if the given atom participates in this Association.- Parameters:
atom
- The atom to be tested if it participates in this Association- Returns:
- true if the atom participates in this Association
-
setAtomAt
public void setAtomAt(IAtom atom, int position)
Sets an Atom in this Association.- Parameters:
atom
- The atom to be setposition
- The position in this Association where the atom is to be inserted- See Also:
getAtomAt(int)
-
toString
public String toString()
Returns a one line string representation of this Container. This method is conform RFC #9.- Specified by:
toString
in interfaceIChemObject
- Overrides:
toString
in classElectronContainer
- Returns:
- The string representation of this Container
-
-