Class Association

    • 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 atom
        atom2 - An atom to be associated with another atom
        See Also:
        Atom
      • Association

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

      • 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
      • 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:
        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 interface IChemObject
        Overrides:
        toString in class ElectronContainer
        Returns:
        The string representation of this Container