📄 update.java
字号:
package executionengine;import compiler.Attribute;import compiler.Caculate;import dataitem.DataItem;import recordmanagement.Tuple;public class Update implements Operation { private Attribute[] attributeList; private Object[] dataList; private Operation belowOpr = null; public Update(Attribute[] att, Object[] obj, Operation opr){ attributeList = att; dataList = obj; belowOpr = opr; } public void open() { belowOpr.open(); } public boolean hasNext() { return belowOpr.hasNext(); } public Tuple getNext() { Tuple tempTuple = belowOpr.getNext(); for(int i = 0; i< dataList.length; i++){ if(dataList[i] instanceof DataItem){ tempTuple.setItem(attributeList[i].attIndex, (DataItem)dataList[i]); }else{ DataItem tempItem = ((Caculate)dataList[i]).getResult(tempTuple); tempTuple.setItem(attributeList[i].attIndex, tempItem); } } return tempTuple; } public void close() { } public Attribute[] getAttributeList() { return belowOpr.getAttributeList(); } }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -