Package org.mozilla.zest.core.v1
Class ZestLoopFile
- java.lang.Object
-
- org.mozilla.zest.core.v1.ZestElement
-
- org.mozilla.zest.core.v1.ZestStatement
-
- org.mozilla.zest.core.v1.ZestLoop<String>
-
- org.mozilla.zest.core.v1.ZestLoopFile
-
- All Implemented Interfaces:
Enumeration<ZestStatement>,ZestContainer
public class ZestLoopFile extends ZestLoop<String>
This class represent a loop through a list of strings given in input through a file.
-
-
Field Summary
-
Fields inherited from class org.mozilla.zest.core.v1.ZestElement
JSON_ELEMENT_TYPE
-
-
Constructor Summary
Constructors Constructor Description ZestLoopFile()Instantiates a new zest loop file.ZestLoopFile(int index, String pathToFile)Instantiates a new zest loop file.ZestLoopFile(String pathToFile)Instantiates a new zest loop file.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ZestLoopFiledeepCopy()Deep copy.voidendLoop()ZestLoopStateFilegetCurrentState()returns the current state of the loop.StringgetCurrentToken()return the current token considered inside the loop.FilegetFile()returns the file of this loop.ZestLoopTokenFileSetgetSet()returns the set of the tokens in this loop.voidincrease()increase the loop indexesbooleanisLastState()checks if the loop is on its last statebooleanloop()voidsetSet(ZestLoopTokenSet<String> set)sets the current state to the new one (for subclasses).voidtoLastState()ends the loop taking its current state to the last state-
Methods inherited from class org.mozilla.zest.core.v1.ZestLoop
add, addStatement, copyStatements, endLoop, getChildBefore, getChildren, getCurrentIndex, getCurrentStatementIndex, getIndex, getLast, getRuntime, getStatement, getStatements, getVariableName, getVariableNames, hasMoreElements, init, init, isPassive, isSameSubclass, loop, move, nextElement, onControlBreak, onControlNext, setCurrentState, setPrefix, setPrev, setStatements, setVariableName
-
Methods inherited from class org.mozilla.zest.core.v1.ZestStatement
getIndex, getNext, getPrevious, init, insertAfter, insertBefore, isEnabled, remove, setEnabled, setNext
-
Methods inherited from class org.mozilla.zest.core.v1.ZestElement
getElementType, setElementType
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.Enumeration
asIterator
-
-
-
-
Constructor Detail
-
ZestLoopFile
public ZestLoopFile() throws IOExceptionInstantiates a new zest loop file.- Throws:
FileNotFoundException- the file not found exceptionIOException- Signals that an I/O exception has occurred.
-
ZestLoopFile
public ZestLoopFile(String pathToFile) throws FileNotFoundException
Instantiates a new zest loop file.- Parameters:
pathToFile- the path to the file which contains the loop values- Throws:
FileNotFoundException- the file not found exception
-
ZestLoopFile
public ZestLoopFile(int index, String pathToFile) throws FileNotFoundExceptionInstantiates a new zest loop file.- Parameters:
index- the index of the statementpathToFile- the path to the file which contains the loop values- Throws:
FileNotFoundException- the file not found exception
-
-
Method Detail
-
deepCopy
public ZestLoopFile deepCopy()
Description copied from class:ZestElementDeep copy.
-
getFile
public File getFile()
returns the file of this loop.- Returns:
- the file of this loop
-
getCurrentState
public ZestLoopStateFile getCurrentState()
Description copied from class:ZestLoopreturns the current state of the loop.- Overrides:
getCurrentStatein classZestLoop<String>- Returns:
- the current state
-
getSet
public ZestLoopTokenFileSet getSet()
Description copied from class:ZestLoopreturns the set of the tokens in this loop.
-
setSet
public void setSet(ZestLoopTokenSet<String> set)
Description copied from class:ZestLoopsets the current state to the new one (for subclasses).
-
isLastState
public boolean isLastState()
Description copied from class:ZestLoopchecks if the loop is on its last state- Specified by:
isLastStatein classZestLoop<String>- Returns:
- true if the loop is over
-
increase
public void increase()
Description copied from class:ZestLoopincrease the loop indexes
-
toLastState
public void toLastState()
Description copied from class:ZestLoopends the loop taking its current state to the last state- Specified by:
toLastStatein classZestLoop<String>
-
getCurrentToken
public String getCurrentToken()
Description copied from class:ZestLoopreturn the current token considered inside the loop.- Overrides:
getCurrentTokenin classZestLoop<String>- Returns:
- the current token considered inside the loop
-
loop
public boolean loop()
-
endLoop
public void endLoop()
-
-