package etomica.atom;

/**
 * Interface for a group of IAtoms, typically a molecule or a SpeciesAgent.
 */
public interface IAtomGroup extends IAtom {

    /**
     * Adds the given Atom as a child of this Atom.  The given child Atom
     * should be parentless when this method is called.
     * @throws IllegalArgumentException if the given atom already has a parent.
     */
    public void addChildAtom(IAtom newChildAtom);

    /**
     * Removes the given child Atom from this AtomGroup.
     * @throws IllegalArgumentException if the given atom is not a child.
     */
    public void removeChildAtom(IAtom oldChildAtom);

    /**
     * Notifies this atom group that an atom has been added to it 
     * or one of its descendants.
     */
    public void addAtomNotify(IAtom childAtom);

    /**
     * Notifies this atom group that an atom has been removed from it or 
     * one of its descendants.
     */
    public void removeAtomNotify(IAtom childAtom);

    /**
     * @return the children as an AtomArrayList
     */
    public AtomArrayList getChildList();

}
@@ -660,36 +660,50 @@
 atom group that 
-an a
+the given child IA
 tom has been add
@@ -710,17 +710,16 @@
 ed to it
- 
 %0A     * 
@@ -736,32 +736,181 @@
 its descendants.
+  This method should be called by addChildAtom%0A     * or by this IAtomGroup's child if the child is an IAtomGroup and has a%0A     * child added to it.
 %0A     */%0A    pub
@@ -1000,12 +1000,26 @@
 hat 
-an a
+the given child IA
 tom 
@@ -1034,16 +1034,23 @@
  removed
+%0A     *
  from it
@@ -1053,24 +1053,16 @@
 m it or 
-%0A     * 
 one of i
@@ -1075,16 +1075,172 @@
 cendants
+.  This method should be called by%0A     * removeChildAtom or by this IAtomGroup's child if the child is an%0A     * IAtomGroup and has a child removed from it
 .%0A     *

add more detailed comments