Class 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:
Source code:
main
Belongs to CDK module:
extra
Keywords:
orbital, association, bond
  • Field Details

    • electronCount

      protected final int electronCount
      Number of electrons in the association.
      See Also:
    • atoms

      protected IAtom[] atoms
      The atoms which take part in the association.
    • atomCount

      protected int atomCount
  • Constructor Details

    • Association

      public Association(IAtom atom1, IAtom atom2)
      Constructs an association between two Atom's.
      Parameters:
      atom1 - An atom to be associated with another atom
      atom2 - An atom to be associated with another atom
      See Also:
    • Association

      public Association()
      Constructs an empty association.
      See Also:
  • Method Details

    • 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

      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:
    • 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 interface IElectronContainer
      Overrides:
      getElectronCount in class ElectronContainer
      Returns:
      The number of electrons in a Association.
      See Also:
    • 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:
    • 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 set
      position - The position in this Association where the atom is to be inserted
      See Also:
    • toString

      public String toString()
      Returns a one line string representation of this Container. This method is conform RFC #9.
      Specified by:
      toString in interface IChemObject
      Overrides:
      toString in class ElectronContainer
      Returns:
      The string representation of this Container