Class ForProgramBlock
- java.lang.Object
-
- org.apache.sysds.runtime.controlprogram.ProgramBlock
-
- org.apache.sysds.runtime.controlprogram.ForProgramBlock
-
- All Implemented Interfaces:
ParseInfo
- Direct Known Subclasses:
ParForProgramBlock
public class ForProgramBlock extends ProgramBlock
-
-
Field Summary
-
Fields inherited from class org.apache.sysds.runtime.controlprogram.ProgramBlock
_beginColumn, _beginLine, _endColumn, _endLine, _filename, _text, PRED_VAR
-
-
Constructor Summary
Constructors Constructor Description ForProgramBlock(Program prog, String iterPredVar)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addProgramBlock(ProgramBlock childBlock)
void
execute(ExecutionContext ec)
Executes this program block (incl recompilation if required).ArrayList<ProgramBlock>
getChildBlocks()
Get the list of child program blocks if nested; otherwise this method returns null.ArrayList<Instruction>
getFromInstructions()
ArrayList<Instruction>
getIncrementInstructions()
String
getIterVar()
ArrayList<Instruction>
getToInstructions()
boolean
isNested()
Indicates if the program block is nested, i.e., if it contains other program blocks (e.g., loops).String
printBlockErrorLocation()
void
setChildBlocks(ArrayList<ProgramBlock> pbs)
void
setFromInstructions(ArrayList<Instruction> instructions)
void
setIncrementInstructions(ArrayList<Instruction> instructions)
void
setToInstructions(ArrayList<Instruction> instructions)
-
Methods inherited from class org.apache.sysds.runtime.controlprogram.ProgramBlock
executePredicate, getBeginColumn, getBeginLine, getEndColumn, getEndLine, getExitInstruction, getFilename, getProgram, getStatementBlock, getText, getThreadID, hasThreadID, isThreadID, setBeginColumn, setBeginLine, setEndColumn, setEndLine, setExitInstruction, setFilename, setParseInfo, setProgram, setStatementBlock, setText, setThreadID
-
-
-
-
Method Detail
-
getFromInstructions
public ArrayList<Instruction> getFromInstructions()
-
setFromInstructions
public void setFromInstructions(ArrayList<Instruction> instructions)
-
getToInstructions
public ArrayList<Instruction> getToInstructions()
-
setToInstructions
public void setToInstructions(ArrayList<Instruction> instructions)
-
getIncrementInstructions
public ArrayList<Instruction> getIncrementInstructions()
-
setIncrementInstructions
public void setIncrementInstructions(ArrayList<Instruction> instructions)
-
addProgramBlock
public void addProgramBlock(ProgramBlock childBlock)
-
setChildBlocks
public void setChildBlocks(ArrayList<ProgramBlock> pbs)
-
getIterVar
public String getIterVar()
-
getChildBlocks
public ArrayList<ProgramBlock> getChildBlocks()
Description copied from class:ProgramBlock
Get the list of child program blocks if nested; otherwise this method returns null.- Specified by:
getChildBlocks
in classProgramBlock
- Returns:
- list of program blocks
-
isNested
public boolean isNested()
Description copied from class:ProgramBlock
Indicates if the program block is nested, i.e., if it contains other program blocks (e.g., loops).- Specified by:
isNested
in classProgramBlock
- Returns:
- true if nested
-
execute
public void execute(ExecutionContext ec)
Description copied from class:ProgramBlock
Executes this program block (incl recompilation if required).- Specified by:
execute
in classProgramBlock
- Parameters:
ec
- execution context
-
printBlockErrorLocation
public String printBlockErrorLocation()
- Overrides:
printBlockErrorLocation
in classProgramBlock
-
-