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

com.scudata.expression.mfn.dw.UpdateMemoryTable 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.mfn.dw;

import com.scudata.common.MessageManager;
import com.scudata.common.RQException;
import com.scudata.dm.Context;
import com.scudata.dm.Sequence;
import com.scudata.expression.MemoryTableFunction;
import com.scudata.resources.EngineMessage;

/**
 * ?????ڱ????ݣ??¼?ֵ????룬???ּ?????
 * T.update(P)
 * @author RunQian
 *
 */
public class UpdateMemoryTable extends MemoryTableFunction {
	public Object calculate(Context ctx) {
		if (param == null) {
			MessageManager mm = EngineMessage.get();
			throw new RQException("update" + mm.getMessage("function.missingParam"));
		}
		
		Object obj = param.getLeafExpression().calculate(ctx);
		if (obj instanceof Sequence) {
			return table.update((Sequence)obj, option);
		} else if (obj == null) {
			if (option == null || option.indexOf('n') == -1) {
				return table;
			} else {
				return null;
			}
		} else {
			MessageManager mm = EngineMessage.get();
			throw new RQException("update" + mm.getMessage("function.paramTypeError"));
		}
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy