/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

package etomica.api;


public interface IAtom {

    /**
     * Returns this IAtom's index, which is its place in the parent AtomGroup's
     * list of child IAtoms.
     */
    public int getIndex();

    /**
     * Informs the IAtom of its index, which is used to construct the address.
     */
    public void setIndex(int index);

    /**
     * Sets the atom's global index to the give value.  This method should only
     * be called by the IBox.
     */
    public void setLeafIndex(int newGlobalIndex);

    /**
     * Returns the global index (within the Box) of this Atom.  The global
     * index is unique to the IAtom in the Box.  The IAtom's global may
     * change over the course of a simulation due to addition or removal of
     * other IAtoms in the Box.  An BoxGlobalAtomIndexEvent is fired by
     * the Box's event manager when an Atom's global index changes. 
     */
    public int getLeafIndex();

    /**
     * Informs the Atom that the given AtomGroup is its parent.
     * This method should only be called by the parent.
     */
    public void setParent(IMolecule newParent);

    /**
     * Returns the parent AtomGruop of this IAtom.
     */
    public IMolecule getParentGroup();

    /**
     * @return the Atom type, holding properties held in common with other 
     * atoms made by this atom's factory.
     */
    public IAtomType getType();

    /**
     * Returns the position of the IAtom.  Modifying the returned IVector will
     * alter the IAtom's position.
     */
    public IVectorMutable getPosition();
}

@@ -221,16 +221,286 @@
 a.api;%0A%0A
+/**%0A * IAtom is an interface for atoms in the simulation.  Atoms have a type%0A * (IAtomType), a position (IVectorMutable) and a parent molecule (IMolecule).%0A * Atoms also have indices (one for the list of atoms in the box, one for the%0A * list of atoms in a molecule).%0A */
 %0Apublic 
@@ -533,23 +533,23 @@
 %0A     * 
-R
+@r
 eturn
-s
  this IA
@@ -720,49 +720,141 @@
 ndex
-,
  w
-hich
+ithin the atoms of
  i
+t
 s 
-used to construct the address.
+parent molecule.%0A     * This should only be called by the parent molecule.%0A     * @param index the new index
 %0A   
@@ -1224,16 +1224,22 @@
  global 
+index 
 may%0A    
@@ -1538,25 +1538,25 @@
 e given 
-AtomGroup
+IMolecule
  is its 
@@ -1613,25 +1613,82 @@
 y the parent
-.
+ molecule.%0A     * @param newParent the new parent molecule
 %0A     */%0A   
@@ -1744,31 +1744,31 @@
  /**%0A     * 
-R
+@r
 eturn
-s
  the parent 
@@ -1771,17 +1771,16 @@
 ent 
-AtomGruop
+molecule
  of 
@@ -1940,35 +1940,24 @@
 oms 
-made by this atom's factory
+of the same type
 .%0A  
@@ -2006,31 +2006,31 @@
  /**%0A     * 
-R
+@r
 eturn
-s
  the positio
@@ -2069,18 +2069,17 @@
 eturned 
-IV
+v
 ector wi

fix javadoc for IAtom