/* 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.box;

import etomica.atom.AtomLeafAgentManager;
import etomica.atom.AtomLeafAgentManager.AgentSource;
import etomica.box.BoxAgentManager.BoxAgentSource;

public class BoxAgentSourceAtomManager<E> implements BoxAgentSource<AtomLeafAgentManager<E>> {

    protected final AgentSource<E> atomAgentSource;
    protected final Class atomAgentClass;

    public BoxAgentSourceAtomManager(AgentSource<E> atomAgentSource, Class atomAgentClass) {
        super();
        this.atomAgentSource = atomAgentSource;
        this.atomAgentClass = atomAgentClass;
    }

    public AtomLeafAgentManager<E> makeAgent(Box box) {
        return new AtomLeafAgentManager<E>(atomAgentSource, box, atomAgentClass);
    }

    public void releaseAgent(AtomLeafAgentManager<E> agent) {
        agent.dispose();
    }
}

@@ -369,16 +369,114 @@
 ource;%0A%0A
+/**%0A * BoxAgentSource that creates an AtomLeafAgentManager.%0A *%0A * @param %3CE%3E atom agent class%0A */%0A
 public c
@@ -658,16 +658,154 @@
 Class;%0A%0A
+    /**%0A     * @param atomAgentSource object that makes the atom agents%0A     * @param atomAgentClass Class specified by &lt;E&gt;%0A     */%0A
     publ

Add javadoc to BoxAgentSourceAtomManager