public class SwitchHandler extends AbstractHandler implements DelimiterListener, CommaListener
Created by Jeff Gaynor
on 7/16/18 at 2:34 PM
closeDelimiterCount, CONDITIONAL_TYPE, FUNCTOR_TYPE, openDelimiterCount, SWITCH_TYPE, used
Constructor and Description |
---|
SwitchHandler(ConditionalHandler conditionalHandler,
JFunctorFactory functorFactory) |
Modifier and Type | Method and Description |
---|---|
void |
closeDelimiter(DelimiterEvent delimeterEvent) |
void |
execute() |
jThen |
getConsequentAt(int index)
Get the logic block at the
index and return the consequent (i.e. |
List<JFunctor> |
getFunctorMapEntry(String key) |
int |
getHandlerType()
Allows for determining the type of handler without resorting to a lot of java class operations.
|
LogicBlocks<? extends LogicBlock> |
getLogicBlocks() |
Object |
getResultAt(int consequentIndex,
int resultIndex)
Fetches the consequent at
consequentIndex then grabs the list at
resultIndex (since consequents have lists of results) and returns the
object. |
void |
gotComma(CommaEvent commaEvent) |
boolean |
hasConsequentAt(int index) |
void |
openDelimiter(DelimiterEvent delimeterEvent) |
void |
reset() |
void |
runLogicBlocks() |
areDelimitersBalanced, convertType, equals, getFunctorFactory, isUsed, toString
public SwitchHandler(ConditionalHandler conditionalHandler, JFunctorFactory functorFactory)
public void runLogicBlocks()
public int getHandlerType()
AbstractHandler
getHandlerType
in class AbstractHandler
public jThen getConsequentAt(int index)
index
and return the consequent (i.e. result of
having executed the logic block.)index
- public Object getResultAt(int consequentIndex, int resultIndex)
consequentIndex
then grabs the list at
resultIndex
(since consequents have lists of results) and returns the
object.consequentIndex
- resultIndex
- public boolean hasConsequentAt(int index)
public LogicBlocks<? extends LogicBlock> getLogicBlocks()
public void execute()
public void gotComma(CommaEvent commaEvent)
gotComma
in interface CommaListener
public void openDelimiter(DelimiterEvent delimeterEvent)
openDelimiter
in interface DelimiterListener
openDelimiter
in class AbstractHandler
public void closeDelimiter(DelimiterEvent delimeterEvent)
closeDelimiter
in interface DelimiterListener
closeDelimiter
in class AbstractHandler
public void reset()
reset
in interface DelimiterListener
reset
in class AbstractHandler
Copyright © 2019. All Rights Reserved.