|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjmri.implementation.AbstractNamedBean
jmri.implementation.DefaultConditional
public class DefaultConditional
Class providing the basic logic of the Conditional interface. This file is part of JMRI.
JMRI is free software; you can redistribute it and/or modify it under the terms of version 2 of the GNU General Public License as published by the Free Software Foundation. See the "COPYING" file for a copy of this license.
JMRI is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
| Field Summary | |
|---|---|
protected ArrayList<ConditionalAction> |
_actionList
|
static boolean |
PARKS_DEBUG
|
| Fields inherited from class jmri.implementation.AbstractNamedBean |
|---|
mSystemName, mUserName |
| Fields inherited from interface jmri.NamedBean |
|---|
INCONSISTENT |
| Constructor Summary | |
|---|---|
DefaultConditional(String systemName)
|
|
DefaultConditional(String systemName,
String userName)
|
|
| Method Summary | |
|---|---|
int |
calculate(boolean enabled,
PropertyChangeEvent evt)
Calculate this Conditional. |
void |
cancelSensorTimer(String sname)
Stop a sensor timer if one is actively delaying setting of the specified sensor |
void |
cancelTurnoutTimer(String sname)
Stop a turnout timer if one is actively delaying setting of the specified turnout |
String |
getAntecedentExpression()
Get antecedent (boolean expression) of Conditional |
ArrayList<ConditionalAction> |
getCopyOfActions()
Make deep clone of actions |
ArrayList<ConditionalVariable> |
getCopyOfStateVariables()
Make deep clone of variables |
static int |
getIndexInTable(int[] table,
int entry)
Inverse map |
int |
getLogicType()
Get type of operators in the antecedent statement |
int |
getState()
State of the Conditional is returned. |
boolean |
getTriggerOnChange()
|
void |
setAction(ArrayList<ConditionalAction> arrayList)
Set list of actions |
void |
setLogicType(int type,
String antecedent)
set the logic type (all AND's all OR's or mixed AND's and OR's set the antecedent expression - should be a well formed boolean statement with parenthesis indicating the order of evaluation |
void |
setState(int state)
State of Conditional is set. |
void |
setStateVariables(ArrayList<ConditionalVariable> arrayList)
Set State Variables for this Conditional. |
void |
setTriggerOnChange(boolean trigger)
Set policy for execution of action list |
String |
validateAntecedent(String ant,
ArrayList<ConditionalVariable> variableList)
Check that an antecedent is well formed |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface jmri.Conditional |
|---|
addPropertyChangeListener, dispose, removePropertyChangeListener |
| Methods inherited from interface jmri.NamedBean |
|---|
addPropertyChangeListener, getComment, getDisplayName, getListenerRef, getListenerRefs, getNumPropertyChangeListeners, getProperty, getPropertyChangeListeners, getPropertyKeys, getSystemName, getUserName, setComment, setProperty, setUserName, updateListenerRef |
| Field Detail |
|---|
public static final boolean PARKS_DEBUG
protected ArrayList<ConditionalAction> _actionList
| Constructor Detail |
|---|
public DefaultConditional(String systemName,
String userName)
public DefaultConditional(String systemName)
| Method Detail |
|---|
public static int getIndexInTable(int[] table,
int entry)
public String getAntecedentExpression()
getAntecedentExpression in interface Conditionalpublic int getLogicType()
getLogicType in interface Conditional
public void setLogicType(int type,
String antecedent)
setLogicType in interface Conditionalpublic boolean getTriggerOnChange()
getTriggerOnChange in interface Conditionalpublic void setTriggerOnChange(boolean trigger)
Conditional
setTriggerOnChange in interface Conditionaltrigger - true execute only on change of statepublic void setStateVariables(ArrayList<ConditionalVariable> arrayList)
This method assumes that all information has been validated.
setStateVariables in interface Conditionalpublic ArrayList<ConditionalVariable> getCopyOfStateVariables()
getCopyOfStateVariables in interface Conditionalpublic void setAction(ArrayList<ConditionalAction> arrayList)
setAction in interface Conditionalpublic ArrayList<ConditionalAction> getCopyOfActions()
getCopyOfActions in interface Conditional
public int calculate(boolean enabled,
PropertyChangeEvent evt)
calculate in interface Conditional
public String validateAntecedent(String ant,
ArrayList<ConditionalVariable> variableList)
validateAntecedent in interface Conditionalpublic void cancelSensorTimer(String sname)
cancelSensorTimer in interface Conditionalpublic void cancelTurnoutTimer(String sname)
cancelTurnoutTimer in interface Conditionalpublic int getState()
getState in interface ConditionalgetState in interface NamedBeanpublic void setState(int state)
setState in interface NamedBean
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||