package genegui; import java.beans.MethodDescriptor; import java.beans.SimpleBeanInfo; import java.io.Serializable; import java.lang.reflect.Method; import java.util.Vector; import parameters.ParameterSet; /** SuccessList.java Accumulates a list of "successful" runs. Two ArrayLists associate a ParamaterSet with the final ModelState of a successful run. @author WJS */ public class SuccessList { /** The list of ModelStates */ private Vector ModelStates; /** The list of ParameterNames */ private Vector ParameterNames; /** The list of ParameterSets */ private Vector ParameterSets; /** The list of scores */ private Vector Scores; /** Simple constructor. @author WJS */ public SuccessList() { ModelStates = new Vector(); ParameterNames = new Vector(); ParameterSets = new Vector(); Scores = new Vector(); } /** Add a new pair to the list. @param ModelState modelState @param ParemeterSet parameterSet @author WJS */ public void add(ModelState modelState, ParameterSet parameterSet, float score, String name) { ModelStates.add(modelState); ParameterSets.add(parameterSet); Scores.add(new Float(score)); ParameterNames.add(name); } /** Clears the contents of the list. @author WJS */ public void clear() { ModelStates = new Vector(); ParameterSets = new Vector(); Scores = new Vector(); ParameterNames = new Vector(); } /** Returns the ModelState from pair index. @param int index @return ModelState @author WJS */ public ModelState getModelState(int index) { return((ModelState)ModelStates.get(index)); } /** Returns a vector with the names of all the results. @param int index @return Vector @author WJS */ public Vector getNames() { return(ParameterNames); } /** Returns the name of the ParameterSet. @param int index @return String @author WJS */ public String getName(int index) { return((String)ParameterNames.get(index)); } /** Returns the ParameterSet from pair index. @param int index @return ParameterSet @author WJS */ public ParameterSet getParameterSet(int index) { return((ParameterSet)ParameterSets.get(index)); } /** Returns the name of the ParameterSet. @param int index @return String @author WJS */ public float getScore(int index) { return(((Float)Scores.get(index)).floatValue()); } /** Returns the number of pairs in the list. @return int @author WJS */ public int size() { return(ModelStates.size()); } public Vector getModelStates() { return(ModelStates); } public void setModelStates(Vector states) { ModelStates = states; } public Vector getParameterNames() { return(ParameterNames); } public void setParameterNames(Vector names) { ParameterNames = names; } public Vector getScores() { return(Scores); } public void setScores(Vector scores) { Scores = scores; } }