Package li.selman.jpbe.dsl.token
Class TokenSequence
java.lang.Object
li.selman.jpbe.dsl.token.TokenSequence
- All Implemented Interfaces:
Iterable<Token>,DslElement
Merges a list of tokens together to a new combined token.
The whole TokenSequence must match.
If no tokens are past, the sequence matches everything
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionbooleanintNote that the size of the DslElement and the size oftokenscan differ! Do not use this method to get the number of tokens in the sequence.intinthashCode()booleanisEmpty()iterator()static TokenSequencestatic TokenSequenceinttoString()union(TokenSequence other) Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Method Details
-
of
-
of
-
getTokens
-
getNumberOfTokens
public int getNumberOfTokens() -
isEmpty
public boolean isEmpty() -
getLastToken
- Returns:
- the last token or
nullif the sequence is empty
-
getMergedPattern
-
union
-
sequenceLength
public int sequenceLength()- Returns:
- the size of
tokens
-
getDslWeight
public int getDslWeight()Note that the size of the DslElement and the size oftokenscan differ! Do not use this method to get the number of tokens in the sequence.- Specified by:
getDslWeightin interfaceDslElement- Returns:
- the weight of the token TokenSequence
-
iterator
-
equals
-
hashCode
public int hashCode() -
toString
-