package message.wechatserveno.shakeshake.instruction;

import message.wechatserveno.shakeshake.Constants;

import net.sf.json.JSONArray;
import net.sf.json.JSONObject;


/**
 * 指令集组合定义
 * @author Administrator
 *
 */
public class InstructionCollection implements IinstructionCollection{
	
	@Override
	public String getInstructionCollection(String[] instructions) {
		// TODO Auto-generated method stub
		String jsonArrayString=null;
		JSONArray ja=JSONArray.fromObject(instructions);
		jsonArrayString=ja.toString();
		return jsonArrayString;
		
	}
	
	public static void main(String[] args) {
		IinstructionCollection ic=new InstructionCollection();
		String[] instructions=new String[2];
		Iinstruction ins=new Instruction();
		instructions[0]=ins.getJsonString(Constants.INSTRUCTION_TYPE_BAT, Constants.BAT_OPEN_URL);
		instructions[1]=ins.getJsonString(Constants.INSTRUCTION_TYPE_BAT, Constants.BAT_OPEN_URL);
		String jsonArrayString = ic.getInstructionCollection(instructions);
		System.out.println(jsonArrayString);
	}
	
}

