com.scudata.ide.spl.etl.ParamInfoList 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.ide.spl.etl;
import java.util.*;
import com.scudata.common.*;
/**
* ??????Ϣ?б?
*
* ?????Ķ???Ԫ?ص????в????ļ???
* @author Joancy
*
*/
public class ParamInfoList {
ArrayList> paramGroups = new ArrayList>();
ArrayList groupNames = new ArrayList();
ArrayList rootList = new ArrayList();
private final static String ROOTGROUP = "RootGroup";
private MessageManager mm = FuncMessage.get();
/**
* ???캯??
*/
public ParamInfoList() {
}
/**
* ??ȡ????????Ϣ?б?
* ????Ԫ?صIJ???ͨ???Ƚ϶࣬???ԻὫ?????????Է???༭
* ????ͨ?õĻ?ֵ?????
* @return ??????Ϣ?б?
*/
private ArrayList getrootList() {
return rootList;
}
/**
* ?????в?????Ϣ
* @param pil ??һ????????Ϣ?б?
*/
public void addAll(ParamInfoList pil) {
//pil?з???????Ҫ??????????????ͬ???ƺϲ?
ArrayList groupNames = pil.getGroupNames();
for( int i=0; i grpParams = pil.getParams(grpName);
for( int n=0;n pis = null;
if (group == null || ROOTGROUP.equalsIgnoreCase(group)) {
pis = rootList;
} else {
group = mm.getMessage(group);
int index = groupNames.indexOf(group);
if (index < 0) {
groupNames.add(group);
pis = new ArrayList();
paramGroups.add(pis);
} else {
pis = paramGroups.get(index);
}
}
if (pis == null) {
pis = rootList;
}
pis.add(pi);
}
/**
* ɾ????group?µ???Ϊname?IJ???
* @param group ??????
* @param name ????????
*/
public void delete(String group, String name){
group = mm.getMessage(group);
delete(getParams(group),name);
}
/**
* ??????????һ????????Ϣ
* @param pi ??????Ϣ
*/
public void add(ParamInfo pi) {
rootList.add(pi);
}
/**
* ɾ???????µ???Ϊname?IJ???
* @param name ????????
*/
public void delete(String name){
delete(rootList,name);
}
/**
* ɾ????????Ϣ?б?list?е???Ϊname?IJ???
* @param list ??????Ϣ?б?
* @param name ????????
*/
public void delete(ArrayList list,String name){
for(int i=0; i getGroupNames() {
return groupNames;
}
/**
* ??ȡ??ΪgroupName????????в?????Ϣ
* @param groupName ??????
* @return ??????Ϣ?б?
*/
public ArrayList getParams(String groupName) {
ArrayList pis = null;
int index = groupNames.indexOf(groupName);
if (index >= 0) {
pis = paramGroups.get(index);
}
if (pis != null)
return pis;
return rootList;
}
/**
* ??ȡ????IJ?????Ϣ
* @return ??????Ϣ?б?
*/
public ArrayList getRootParams() {
return rootList;
}
/**
* ?????в??????ҵ???Ϊname?IJ?????Ϣ
* @param name ????????
* @return ??????Ϣ???Ҳ???ʱ????null
*/
public ParamInfo getParamInfoByName(String name) {
ArrayList aps = getAllParams();
int infoSize = aps.size();
for (int i = 0; i < infoSize; i++) {
ParamInfo pi = (ParamInfo) aps.get(i);
if (pi.getName().equalsIgnoreCase(name)) {
return pi;
}
}
return null;
}
/**
* ??ȡ???????ȫ????????Ϣ
* @return ??????Ϣ?б?
*/
public ArrayList getAllParams() {
ArrayList aps = new ArrayList();
int size = rootList == null ? 0 : rootList.size();
for (int i = 0; i < size; i++) {
aps.add(rootList.get(i));
}
size = paramGroups == null ? 0 : paramGroups.size();
for (int i = 0; i < size; i++) {
ArrayList pis = paramGroups.get(i);
int ps = pis == null ? 0 : pis.size();
for (int j = 0; j < ps; j++) {
aps.add(pis.get(j));
}
}
return aps;
}
/**
* ?????в???ִ?п?ֵ???
*/
public void check(){
ArrayList all = getAllParams();
for(ParamInfo pi:all){
pi.check();
}
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy