view src/MPipeline2/src/mpipeline/workspace/Workspace.java @ 16:91f21a0aab35 database-connection-manager

Update utils.jquery * * * Update utils.jmysql.getsinfo
author Daniele Nicolodi <nicolodi@science.unitn.it>
date Mon, 05 Dec 2011 16:20:06 +0100
parents f0afece42f48
children
line wrap: on
line source

/*
 * Class Workspace <one line to give the program's name and a brief idea of what it does.>
 *
 * Copyright (c) 2009 Max-Planck-Gesellschaft, Martin Hewitson <martin.hewitson at aei.mpg.de>
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 *
 */
package mpipeline.workspace;

import java.util.ArrayList;

/**
 * A class that represents a current snapshot of the MATLAB workspace. The structure
 * of this representation is based on MATLAB structures (which can then be expanded)
 * and MATLAB variables, including objects. We store here the variable details taken
 * from the workspace so that they can be identified again on the MATLAB side.
 * 
 * @author Martin Hewitson <martin.hewitson at aei.mpg.de>
 */
public class Workspace {

  private ArrayList<WorkspaceStruct> structs = new ArrayList<WorkspaceStruct>();
  private ArrayList<WorkspaceVar> vars = new ArrayList<WorkspaceVar>();

  public Workspace() {
  }

  public int Nstructs() {
    return structs.size();
  }

  public int Nvars() {
    return vars.size();
  }

  public void addStruct(WorkspaceStruct aStruct) {
    structs.add(aStruct);
  }

  public void addVar(WorkspaceVar aVar) {
    vars.add(aVar);
  }

  public WorkspaceStruct getStruct(int index) {
    return structs.get(index);
  }

  public WorkspaceVar getVar(int index) {
    return vars.get(index);
  }

  public ArrayList<WorkspaceStruct> getStructs() {
    return structs;
  }

  public void setStructs(ArrayList<WorkspaceStruct> structs) {
    this.structs = structs;
  }

  public ArrayList<WorkspaceVar> getVars() {
    return vars;
  }

  public void setVars(ArrayList<WorkspaceVar> vars) {
    this.vars = vars;
  }


  @Override
  public String toString() {
    return "workspace";
  }
  

}