Package org.mozilla.zest.core.v1
Class ZestLoopTokenIntegerSet
- java.lang.Object
-
- org.mozilla.zest.core.v1.ZestElement
-
- org.mozilla.zest.core.v1.ZestLoopTokenIntegerSet
-
- All Implemented Interfaces:
ZestLoopTokenSet<Integer>
public class ZestLoopTokenIntegerSet extends ZestElement implements ZestLoopTokenSet<Integer>
The Class ZestLoopTokenIntegerSet.
-
-
Field Summary
-
Fields inherited from class org.mozilla.zest.core.v1.ZestElement
JSON_ELEMENT_TYPE
-
-
Constructor Summary
Constructors Constructor Description ZestLoopTokenIntegerSet()Instantiates a new zest loop token integer set with default values:
start=end=0.ZestLoopTokenIntegerSet(int indexStart, int indexEnd)Instantiates a new zest loop token integer set.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ZestLoopTokenIntegerSetdeepCopy()Deep copy.booleanequals(Object obj)intgetEnd()Gets the end.ZestLoopStateIntegergetFirstState()Gets the first state.IntegergetLastToken()returns the last token the loop may consider.intgetStart()Gets the start.protected intgetStep()IntegergetToken(int index)returns the token at a given index.inthashCode()intindexOf(Integer token)returns the index of a given token.protected voidsetStep(int newStep)intsize()returns the size of this set.-
Methods inherited from class org.mozilla.zest.core.v1.ZestElement
getElementType, isSameSubclass, setElementType
-
-
-
-
Constructor Detail
-
ZestLoopTokenIntegerSet
public ZestLoopTokenIntegerSet()
Instantiates a new zest loop token integer set with default values:
start=end=0. Note that this is a final state!
-
ZestLoopTokenIntegerSet
public ZestLoopTokenIntegerSet(int indexStart, int indexEnd)Instantiates a new zest loop token integer set.- Parameters:
indexStart- the index startindexEnd- the index end
-
-
Method Detail
-
getStart
public int getStart()
Gets the start.- Returns:
- the start
-
getEnd
public int getEnd()
Gets the end.- Returns:
- the end
-
deepCopy
public ZestLoopTokenIntegerSet deepCopy()
Description copied from class:ZestElementDeep copy.- Specified by:
deepCopyin interfaceZestLoopTokenSet<Integer>- Specified by:
deepCopyin classZestElement- Returns:
- the zest element
-
getToken
public Integer getToken(int index)
Description copied from interface:ZestLoopTokenSetreturns the token at a given index.- Specified by:
getTokenin interfaceZestLoopTokenSet<Integer>- Parameters:
index- the index of the token- Returns:
- the token at the given index
-
indexOf
public int indexOf(Integer token)
Description copied from interface:ZestLoopTokenSetreturns the index of a given token.- Specified by:
indexOfin interfaceZestLoopTokenSet<Integer>- Parameters:
token- the token whose index we are searching for- Returns:
- the index of the token
-
getLastToken
public Integer getLastToken()
Description copied from interface:ZestLoopTokenSetreturns the last token the loop may consider.- Specified by:
getLastTokenin interfaceZestLoopTokenSet<Integer>- Returns:
- the last token the loop may consider
-
size
public int size()
Description copied from interface:ZestLoopTokenSetreturns the size of this set.- Specified by:
sizein interfaceZestLoopTokenSet<Integer>- Returns:
- the size of this set
-
getFirstState
public ZestLoopStateInteger getFirstState()
Description copied from interface:ZestLoopTokenSetGets the first state.- Specified by:
getFirstStatein interfaceZestLoopTokenSet<Integer>- Returns:
- the first state
-
setStep
protected void setStep(int newStep)
-
getStep
protected int getStep()
-
-