📄 maprowseq.java
字号:
package MyNa.xml;
import java.util.*;
import java.io.*;
import MyNa.utils.*;
public class MapRowSeq extends RowSeq {
RowSeq innerRows;
String fieldName; int fieldNum; String val;
// used in most common case, in which a field
// is set to be a particular value. May be
// used for other purposes with mapFunction
// overridden.
public MapRowSeq(RowSeq re)throws Exception{
super();
innerRows=re; shallowClone(re);
fieldName=null; fieldNum=-1; val=null;
}
public MapRowSeq(String field,String val,RowSeq re)
throws Exception{
super();
innerRows=re; shallowClone(re);
fieldName=field; this.val=val;
if(theColumnLabels!=null)
for(int i=0;i<theColumnLabels.length;i++)
if(theColumnLabels[i].equals(field))
{fieldNum=i; return;}
}
public void mapFunction(){ // applied to each Env.
if(fieldNum>=0)theColumnValues[fieldNum]=val;
theEnv.put(fieldName,val);
}
public boolean next(){
if(!innerRows.next())return false;
mapFunction();
return true;
}
} // end MapRowEnum
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -