All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.scudata.expression.CreateRecord Maven / Gradle / Ivy

Go to download

SPL(Structured Process Language) A programming language specially for structured data computing.

There is a newer version: 20240823
Show newest version
package com.scudata.expression;

import com.scudata.dm.Context;
import com.scudata.dm.DataStruct;
import com.scudata.dm.Record;

/**
 * ??????¼
 * {f1:v1,...} ?ֶ????dz?????ֵ?DZ???ʽ
 * @author RunQian
 *
 */
public class CreateRecord extends Function {
	
	public Node optimize(Context ctx) {
		if (param != null) {
			param.optimize(ctx);
		}
		
		return this;
	}
	
	public Object calculate(Context ctx) {
		ParamInfo2 pi = ParamInfo2.parse(param, "{}", true, true);
		String []names = pi.getExpressionStrs1();
		Object []values = pi.getValues2(ctx);
		DataStruct ds = new DataStruct(names);
		return new Record(ds, values);
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy