001    // GraphLab Project: http://graphlab.sharif.edu
002    // Copyright (C) 2008 Mathematical Science Department of Sharif University of Technology
003    // Distributed under the terms of the GNU General Public License (GPL): http://www.gnu.org/licenses/
004    
005    package graphlab.plugins.connector;
006    
007    import graphlab.platform.attribute.AttributeSet;
008    import graphlab.platform.attribute.AttributeSetImpl;
009    
010    import java.util.Vector;
011    
012    /**
013     * The base abstracting class for a connector, this class is under developement, I hope it will have a parse(file) and a
014     * run(shell) method
015     *
016     * @author Azin Azadi , Mohammad Ali Rostami
017     */
018    public class ConnectorDS {
019        //    public String name;  //commandName used instead
020        public String description;
021        public AttributeSet atrs = new AttributeSetImpl();
022        /**
023         * provides the name of arguments of shell method!!?? it holds the order of variables in the corresponding
024         * shell method call, the values are stored in atrs,
025         * <p> </p>
026         * see graphlab.plugins.connector.matlab.MatlabExtensionLoader.parseMatlabFile(File matlabfile)
027         *
028         * @see ConnectorDS.getArgs()
029         */
030        public Vector<String> shellMethodArgs = new Vector<String>();
031        public String commandName;
032        public String command;
033    
034        public String getArgs() {
035            String ret = "";
036            boolean b = false;
037            for (String name : shellMethodArgs) {
038                ret += atrs.get(name) + " ,";
039                b = true;
040            }
041            if (b)
042                ret = ret.substring(0, ret.length() - 1);
043            return ret;
044        }
045    
046    }