Package org.mozilla.zest.core.v1
Class ZestLoopInteger
- java.lang.Object
-
- org.mozilla.zest.core.v1.ZestElement
-
- org.mozilla.zest.core.v1.ZestStatement
-
- org.mozilla.zest.core.v1.ZestLoop<Integer>
-
- org.mozilla.zest.core.v1.ZestLoopInteger
-
- All Implemented Interfaces:
Enumeration<ZestStatement>,ZestContainer
public class ZestLoopInteger extends ZestLoop<Integer>
This class represent a loop through a set of integers.
-
-
Field Summary
-
Fields inherited from class org.mozilla.zest.core.v1.ZestElement
JSON_ELEMENT_TYPE
-
-
Constructor Summary
Constructors Constructor Description ZestLoopInteger()Instantiates a new zest loop integer.ZestLoopInteger(int start, int end)Instantiates a new zest loop integer.ZestLoopInteger(int index, int start, int end)Instantiates a new zest loop integer.ZestLoopInteger(String name)Instantiates a new zest loop integer.ZestLoopInteger(String name, int start, int end)Instantiates a new zest loop integer.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ZestLoopIntegerdeepCopy()Deep copy.voidendLoop()ZestLoopStateIntegergetCurrentState()returns the current state of the loop.IntegergetCurrentToken()return the current token considered inside the loop.intgetEnd()Gets the end index.ZestLoopTokenIntegerSetgetSet()returns the set of the tokens in this loop.intgetStart()Gets the start index.intgetStep()returns the step of this loopvoidincrease()increase the loop indexesbooleanisLastState()checks if the loop is on its last statebooleanloop()voidsetEnd(int newEnd)sets the new end indexvoidsetSet(ZestLoopTokenSet<Integer> newSet)sets the current state to the new one (for subclasses).voidsetStart(int newStart)sets a new start indexvoidsetStep(int step)sets the step for the loopvoidtoLastState()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
-
ZestLoopInteger
public ZestLoopInteger()
Instantiates a new zest loop integer.
-
ZestLoopInteger
public ZestLoopInteger(String name)
Instantiates a new zest loop integer.- Parameters:
name- the name of the loop
-
ZestLoopInteger
public ZestLoopInteger(String name, int start, int end)
Instantiates a new zest loop integer.- Parameters:
name- the name of the loopstart- the start indexend- the end index
-
ZestLoopInteger
public ZestLoopInteger(int index, int start, int end)Instantiates a new zest loop integer.- Parameters:
index- the index of the statementstart- the start indexend- the end index
-
ZestLoopInteger
public ZestLoopInteger(int start, int end)Instantiates a new zest loop integer.- Parameters:
start- the start indexend- the end index
-
-
Method Detail
-
getStart
public int getStart()
Gets the start index.- Returns:
- the start index
-
getEnd
public int getEnd()
Gets the end index.- Returns:
- the end index
-
getCurrentState
public ZestLoopStateInteger getCurrentState()
Description copied from class:ZestLoopreturns the current state of the loop.- Overrides:
getCurrentStatein classZestLoop<Integer>- Returns:
- the current state
-
setStep
public void setStep(int step)
sets the step for the loop- Parameters:
step- the step for this loop
-
getStep
public int getStep()
returns the step of this loop- Returns:
- the step of this loop
-
deepCopy
public ZestLoopInteger deepCopy()
Description copied from class:ZestElementDeep copy.
-
getSet
public ZestLoopTokenIntegerSet getSet()
Description copied from class:ZestLoopreturns the set of the tokens in this loop.
-
setSet
public void setSet(ZestLoopTokenSet<Integer> newSet)
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<Integer>- 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<Integer>
-
getCurrentToken
public Integer getCurrentToken()
Description copied from class:ZestLoopreturn the current token considered inside the loop.- Overrides:
getCurrentTokenin classZestLoop<Integer>- Returns:
- the current token considered inside the loop
-
loop
public boolean loop()
-
endLoop
public void endLoop()
-
setStart
public void setStart(int newStart)
sets a new start index- Parameters:
newStart- the new start index
-
setEnd
public void setEnd(int newEnd)
sets the new end index- Parameters:
newEnd- the new end index
-
-