package innovimax.mixthem.operation;

import static innovimax.mixthem.MixConstants.*;
import innovimax.mixthem.MixException;
import innovimax.mixthem.arguments.RuleParam;
import innovimax.mixthem.arguments.ParamValue;

import java.util.Map;

/**
* <p>Zips two characters.</p>
* @see CharOperation
* @author Innovimax
* @version 1.0
*/
public class DefaultCharZipping extends AbstractCharOperation {

	/**
	* Constructor
 	* @param params The list of parameters (maybe empty)
	* @see innovimax.mixthem.arguments.RuleParam
	* @see innovimax.mixthem.arguments.ParamValue
	*/
	public DefaultCharZipping(Map<RuleParam, ParamValue> params) {
		super(params);
	}
	
	@Override
	public int[] process(int c1, int c2) throws MixException {
		String sep = DEFAULT_ZIP_SEPARATOR;
		if (this.params.containsKey(RuleParam._ZIP_SEP)) {
			sep = this.params.get(RuleParam._ZIP_SEP).asString();
		}
		int len = (c1 != -1 ? 1 : 0) + sep.length() + (c2 != -1 ? 1 : 0);
        	int[] zip = new int[len];
		if (c1 != -1) { 
			zip[0] = c1; 
		}
        	for (int i = 0; i < sep.length(); i++) {			
			zip[i + 1] = (int) sep.charAt(i);
		}		
		if (c2 != -1) { 
			zip[zip.length - 1] = c2; 
		}        	
		return zip;
	}

}

@@ -391,16 +391,45 @@
 ration %7B
+%0A%09%0A%09private final String sep;
 %0A%0A%09/**%0A%09
@@ -680,92 +680,14 @@
 );%0A%09
-%7D%0A%09%0A%09@Override%0A%09public int%5B%5D process(int c1, int c2) throws MixException %7B%0A%09%09String 
+%09this.
 sep 
@@ -717,21 +717,16 @@
 ;%0A%09%09if (
-this.
 params.c
@@ -766,19 +766,19 @@
 %0A%09%09%09
+this.
 sep = 
-this.
 para
@@ -820,16 +820,92 @@
 ();%0A%09%09%7D%0A
+%09%7D%0A%09%0A%09@Override%0A%09public int%5B%5D process(int c1, int c2) throws MixException %7B%0A
 %09%09int le

move params setting to constructor