Package org.mozilla.zest.core.v1
Class ZestLoopTokenRegexSet
- java.lang.Object
-
- org.mozilla.zest.core.v1.ZestElement
-
- org.mozilla.zest.core.v1.ZestLoopTokenRegexSet
-
- All Implemented Interfaces:
ZestLoopTokenSet<String>
public class ZestLoopTokenRegexSet extends ZestElement implements ZestLoopTokenSet<String>
The Class ZestLoopTokenRegexSet.
This class does not override ZestLoopTokenStringSet because
the tokens inside the converted set must not be transient
-
-
Field Summary
-
Fields inherited from class org.mozilla.zest.core.v1.ZestElement
JSON_ELEMENT_TYPE
-
-
Constructor Summary
Constructors Constructor Description ZestLoopTokenRegexSet()ZestLoopTokenRegexSet(ZestLoopRegex loop, String inputVariableName, String regex, int group, boolean caseExact)Instantiates a newZestLoopTokenRegexSet.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ZestLoopTokenRegexSetdeepCopy()Deep copy.protected ZestLoopTokenStringSetgetConvertedSet()private method for initialization of the loop (TokenSet & first state).ZestLoopStateRegexgetFirstState()Gets the first state.intgetGroupIndex()StringgetInputVariableName()StringgetLastToken()returns the last token the loop may consider.ZestLoopRegexgetLoop()StringgetRegex()StringgetToken(int index)returns the token at a given index.List<String>getTokens()intindexOf(String token)returns the index of a given token.booleanisCaseExact()voidsetCaseExact(boolean caseExact)voidsetConvertedSet(ZestLoopTokenStringSet convertedSet)voidsetGroupIndex(int groupIndex)voidsetInputVariableName(String inputVariableName)voidsetLoop(ZestLoopRegex loop)voidsetRegex(String regex)intsize()returns the size of this set.-
Methods inherited from class org.mozilla.zest.core.v1.ZestElement
getElementType, isSameSubclass, setElementType
-
-
-
-
Constructor Detail
-
ZestLoopTokenRegexSet
public ZestLoopTokenRegexSet()
-
ZestLoopTokenRegexSet
public ZestLoopTokenRegexSet(ZestLoopRegex loop, String inputVariableName, String regex, int group, boolean caseExact)
Instantiates a newZestLoopTokenRegexSet.- Parameters:
loop- the loop.inputVariableName- the name of the variable.regex- the regular expression.group- the group to get from the regular expression.caseExact-trueif the match is case sensitive,falseotherwise.
-
-
Method Detail
-
getConvertedSet
protected ZestLoopTokenStringSet getConvertedSet()
private method for initialization of the loop (TokenSet & first state).- Returns:
- the zest loop token string set
-
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
-
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 ZestLoopTokenRegexSet deepCopy()
Description copied from class:ZestElementDeep copy.- Specified by:
deepCopyin interfaceZestLoopTokenSet<String>- Specified by:
deepCopyin classZestElement- Returns:
- the zest element
-
getInputVariableName
public String getInputVariableName()
-
getRegex
public String getRegex()
-
isCaseExact
public boolean isCaseExact()
-
getLoop
public ZestLoopRegex getLoop()
-
setInputVariableName
public void setInputVariableName(String inputVariableName)
-
setRegex
public void setRegex(String regex)
-
getGroupIndex
public int getGroupIndex()
-
setGroupIndex
public void setGroupIndex(int groupIndex)
-
setCaseExact
public void setCaseExact(boolean caseExact)
-
setLoop
public void setLoop(ZestLoopRegex loop)
-
setConvertedSet
public void setConvertedSet(ZestLoopTokenStringSet convertedSet)
-
getFirstState
public ZestLoopStateRegex getFirstState()
Description copied from interface:ZestLoopTokenSetGets the first state.- Specified by:
getFirstStatein interfaceZestLoopTokenSet<String>- Returns:
- the first state
-
-