Interface IAtom

    • Method Detail

      • setCharge

        void setCharge​(Double charge)
        Sets the partial charge of this atom.
        Parameters:
        charge - The partial charge
        See Also:
        getCharge()
      • setImplicitHydrogenCount

        void setImplicitHydrogenCount​(Integer hydrogenCount)
        Sets the implicit hydrogen count of this atom.
        Parameters:
        hydrogenCount - The number of hydrogen atoms bonded to this atom.
        See Also:
        getImplicitHydrogenCount()
      • setPoint2d

        void setPoint2d​(javax.vecmath.Point2d point2d)
        Sets a point specifying the location of this atom in a 2D space.
        Parameters:
        point2d - A point in a 2D plane
        See Also:
        getPoint2d()
      • setPoint3d

        void setPoint3d​(javax.vecmath.Point3d point3d)
        Sets a point specifying the location of this atom in 3D space.
        Parameters:
        point3d - A point in a 3-dimensional space
        See Also:
        getPoint3d()
      • setFractionalPoint3d

        void setFractionalPoint3d​(javax.vecmath.Point3d point3d)
        Sets a point specifying the location of this atom in a Crystal unit cell.
        Parameters:
        point3d - A point in a 3d fractional unit cell space
        See Also:
        getFractionalPoint3d(), Crystal
      • getPoint2d

        javax.vecmath.Point2d getPoint2d()
        Returns a point specifying the location of this atom in a 2D space.
        Returns:
        A point in a 2D plane. Null if unset.
        See Also:
        setPoint2d(javax.vecmath.Point2d)
      • getPoint3d

        javax.vecmath.Point3d getPoint3d()
        Returns a point specifying the location of this atom in a 3D space.
        Returns:
        A point in 3-dimensional space. Null if unset.
        See Also:
        setPoint3d(javax.vecmath.Point3d)
      • getContainer

        IAtomContainer getContainer()
        Access the IAtomContainer of which this atom is a member of. Because atoms can be in multiple molecules this method will only work if the atom has been accessed in the context of an IAtomContainer, for example:
        
         IAtomContainer mol  = new AtomContainer();
         IAtom          atom = new Atom(6);
        
         atom.getContainer(); // null
         mol.add(atom);
         atom.getContainer(); // still null
         mol.getAtom(0).getContainer(); // not-null, returns 'mol'
         
        Returns:
        the atom container or null if not accessed in the context of a container
      • getIndex

        int getIndex()
        Acces the index of an atom in the context of an IAtomContainer. If the index is not known, < 0 is returned.
        Returns:
        atom index or < 0 if the index is not known
      • bonds

        Iterable<IBond> bonds()
        Returns the bonds connected to this atom. If the bonds are not known an exception is thrown. This method will only throw an exception if getIndex() returns < 0 or getContainer() returns null.
        
        
         IAtom atom = ...;
        
         if (atom.getIndex() >= 0) {
           for (IBond bond : atom.bonds()) {
        
           }
         }
        
         if (atom.getContainer() != null) {
           for (IBond bond : atom.bonds()) {
        
           }
         }
        
         IAtomContainer mol = ...;
         // guaranteed not throw an exception
         for (IBond bond : mol.getAtom(i).bonds()) {
        
         }
         
        Returns:
        iterable of bonds
        Throws:
        UnsupportedOperationException - thrown if the bonds are not known
      • getBondCount

        int getBondCount()
        Get the number of explicit bonds connected to this atom.
        Returns:
        the total bond count
      • getBond

        IBond getBond​(IAtom atom)
        Returns the bond connecting 'this' atom to the provided atom. If the atoms are not bonded, null is returned.
        Parameters:
        atom - the other atom
        Returns:
        the bond connecting the atoms
        Throws:
        UnsupportedOperationException - thrown if the bonds are not known
      • isAromatic

        boolean isAromatic()
        Access whether this atom has been marked as aromatic. The default value is false and you must explicitly perceive aromaticity with one of the available models.
        Returns:
        aromatic status
        See Also:
        IChemObject.getFlag(int), Aromaticity
      • setIsAromatic

        void setIsAromatic​(boolean arom)
        Mark this atom as being aromatic.
        Parameters:
        arom - aromatic status
        See Also:
        IChemObject.setFlag(int, boolean)
      • isInRing

        boolean isInRing()
        Access whether this atom has been flagged as in a ring. The default value is false and you must explicitly find rings first.
        Returns:
        ring status
        See Also:
        IChemObject.getFlag(int), RingSearch
      • getMapIdx

        int getMapIdx()
        Access the map index for this atom.
        Returns:
        the map index (0 if not set)
      • setMapIdx

        void setMapIdx​(int mapidx)
        Set the map index for this atom.
        Parameters:
        mapidx - the new map index