com.scudata.dw.StructManager Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of esproc Show documentation
Show all versions of esproc Show documentation
SPL(Structured Process Language) A programming language specially for structured data computing.
package com.scudata.dw;
/**
* ?ṹ??????
*/
import java.util.ArrayList;
import com.scudata.dm.DataStruct;
public final class StructManager {
private ArrayList dsList; // ???е????ݽṹ
private transient DataStruct prevDs; // ǰһ???????ֶε????ݽṹ
private transient int prevDsID = -1; // ???ݽṹ?ı?ʶ??????dsList?е?????
public StructManager() {
dsList = new ArrayList();
}
public StructManager(ArrayList list) {
this.dsList = list;
}
public ArrayList getStructList() {
return dsList;
}
public int getDataStructID(DataStruct ds) {
if (prevDs != null && prevDs.isCompatible(ds)) {
return prevDsID;
}
ArrayList dsList = this.dsList;
for (int i = 0, size = dsList.size(); i < size; ++i) {
if (ds.isCompatible(dsList.get(i))) {
prevDs = ds;
prevDsID = i;
return i;
}
}
prevDs = ds;
prevDsID = dsList.size();
dsList.add(ds);
return prevDsID;
}
public DataStruct getDataStruct(int id) {
return dsList.get(id);
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy