Package org.mozilla.zest.core.v1
Class ZestLoopTokenStringSet
- java.lang.Object
-
- org.mozilla.zest.core.v1.ZestElement
-
- org.mozilla.zest.core.v1.ZestLoopTokenStringSet
-
- All Implemented Interfaces:
ZestLoopTokenSet<String>
public class ZestLoopTokenStringSet extends ZestElement implements ZestLoopTokenSet<String>
The Class ZestLoopTokenStringSet.
-
-
Field Summary
-
Fields inherited from class org.mozilla.zest.core.v1.ZestElement
JSON_ELEMENT_TYPE
-
-
Constructor Summary
Constructors Constructor Description ZestLoopTokenStringSet()Instantiates a new zest loop token string set.ZestLoopTokenStringSet(String[] values)Instantiates a new zest loop token string set.ZestLoopTokenStringSet(List<String> tokens)Instantiates a new zest loop token string set.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddToken(String token)ZestLoopTokenStringSetdeepCopy()Deep copy.ZestLoopStateStringgetFirstState()Gets the first state.StringgetLastToken()returns the last token the loop may consider.StringgetToken(int index)returns the token at a given index.List<String>getTokens()returns the tokens of this SetintindexOf(String token)returns the index of a given token.StringremoveToken(int index)Removes the token.Stringreplace(int indexOfReplace, String newToken)Replace.intsize()returns the size of this set.-
Methods inherited from class org.mozilla.zest.core.v1.ZestElement
getElementType, isSameSubclass, setElementType
-
-
-
-
Constructor Detail
-
ZestLoopTokenStringSet
public ZestLoopTokenStringSet()
Instantiates a new zest loop token string set.
-
ZestLoopTokenStringSet
public ZestLoopTokenStringSet(List<String> tokens)
Instantiates a new zest loop token string set.- Parameters:
tokens- the tokens
-
ZestLoopTokenStringSet
public ZestLoopTokenStringSet(String[] values)
Instantiates a new zest loop token string set.- Parameters:
values- the values
-
-
Method Detail
-
addToken
public void addToken(String token)
-
getToken
public String getToken(int index)
Description copied from interface:ZestLoopTokenSetreturns the token at a given index.- Specified by:
getTokenin interfaceZestLoopTokenSet<String>- Parameters:
index- the index of the token- Returns:
- the token at the given index
-
getTokens
public List<String> getTokens()
returns the tokens of this Set- Returns:
- the tokens of this set
-
indexOf
public int indexOf(String token)
Description copied from interface:ZestLoopTokenSetreturns the index of a given token.- Specified by:
indexOfin interfaceZestLoopTokenSet<String>- Parameters:
token- the token whose index we are searching for- Returns:
- the index of the token
-
getLastToken
public String getLastToken()
Description copied from interface:ZestLoopTokenSetreturns the last token the loop may consider.- Specified by:
getLastTokenin interfaceZestLoopTokenSet<String>- 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<String>- Returns:
- the size of this set
-
deepCopy
public ZestLoopTokenStringSet deepCopy()
Description copied from class:ZestElementDeep copy.- Specified by:
deepCopyin interfaceZestLoopTokenSet<String>- Specified by:
deepCopyin classZestElement- Returns:
- the zest element
-
removeToken
public String removeToken(int index)
Removes the token.- Parameters:
index- the index- Returns:
- the string
-
replace
public String replace(int indexOfReplace, String newToken)
Replace.- Parameters:
indexOfReplace- the index of replacenewToken- the new token- Returns:
- the string
-
getFirstState
public ZestLoopStateString getFirstState()
Description copied from interface:ZestLoopTokenSetGets the first state.- Specified by:
getFirstStatein interfaceZestLoopTokenSet<String>- Returns:
- the first state
-
-