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

com.scudata.expression.mfn.file.Import Maven / Gradle / Ivy

Go to download

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

There is a newer version: 20241126
Show newest version
package com.scudata.expression.mfn.file;

import com.scudata.dm.Context;
import com.scudata.dm.DataStruct;
import com.scudata.dm.Sequence;
import com.scudata.dm.Table;
import com.scudata.dm.cursor.ICursor;
import com.scudata.expression.FileFunction;

/**
 * ???ı??ļ????߼??ļ?????????
 * f.import(Fi:type:fmt,??;k:n,s)
 * @author RunQian
 *
 */
public class Import extends FileFunction {
	public Object calculate(Context ctx) {
		// file.cursor??@xѡ???ֹ??д??@x???ļ?ɾ??
		String option = this.option;
		if (option != null) {
			option = option.replace('x', ' ');
		}
		
		ICursor cursor = CreateCursor.createCursor("import", file, cs, param, option, ctx);
		Sequence seq = cursor.fetch();
		
		if (seq != null) {
			return seq;
		} else {
			DataStruct ds = cursor.getDataStruct();
			if (ds != null) {
				return new Table(ds);
			} else {
				return null;
			}
		}
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy