Package jmri
Class CommonTurnoutOperation
- java.lang.Object
-
- jmri.beans.PropertyChangeSupport
-
- jmri.TurnoutOperation
-
- jmri.CommonTurnoutOperation
-
- All Implemented Interfaces:
java.lang.Comparable<java.lang.Object>
,PropertyChangeFirer
,PropertyChangeProvider
- Direct Known Subclasses:
NoFeedbackTurnoutOperation
,RawTurnoutOperation
,SensorTurnoutOperation
public abstract class CommonTurnoutOperation extends TurnoutOperation
Specialization of TurnoutOperation to contain common properties and methods for concrete subclasses.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) int
interval
static int
intervalStepSize
static int
maxInterval
static int
maxMaxTries
(package private) int
maxTries
static int
minInterval
static int
minMaxTries
-
Fields inherited from class jmri.TurnoutOperation
feedbackModes, name, nonce
-
Fields inherited from class jmri.beans.PropertyChangeSupport
propertyChangeSupport
-
-
Constructor Summary
Constructors Constructor Description CommonTurnoutOperation(java.lang.String name, int interval, int maxTries)
Create common properties for Turnout Operation.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description boolean
equivalentTo(TurnoutOperation other)
abstract int
getDefaultInterval()
abstract int
getDefaultMaxTries()
int
getInterval()
int
getMaxTries()
abstract TurnoutOperator
getOperator(AbstractTurnout t)
Get a TurnoutOperator instance for this operation.void
setInterval(int newInterval)
Set new value for interval.void
setMaxTries(int newMaxTries)
Set new value for MaxTries.-
Methods inherited from class jmri.TurnoutOperation
compareTo, dispose, equals, getDefinitive, getName, getToolTip, hashCode, isDefinitive, isDeleted, isInUse, isNonce, makeCopy, makeNonce, matchFeedbackMode, rename, setFeedbackModes, setNonce
-
Methods inherited from class jmri.beans.PropertyChangeSupport
addPropertyChangeListener, addPropertyChangeListener, fireIndexedPropertyChange, fireIndexedPropertyChange, fireIndexedPropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getPropertyChangeListeners, getPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListener
-
-
-
-
Field Detail
-
interval
int interval
-
maxTries
int maxTries
-
minInterval
public static final int minInterval
- See Also:
- Constant Field Values
-
maxInterval
public static final int maxInterval
- See Also:
- Constant Field Values
-
intervalStepSize
public static final int intervalStepSize
- See Also:
- Constant Field Values
-
minMaxTries
public static final int minMaxTries
- See Also:
- Constant Field Values
-
maxMaxTries
public static final int maxMaxTries
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
CommonTurnoutOperation
public CommonTurnoutOperation(java.lang.String name, int interval, int maxTries)
Create common properties for Turnout Operation.- Parameters:
name
- Operator Name.interval
- Interval between retries.maxTries
- maximum retry attempts.
-
-
Method Detail
-
getOperator
public abstract TurnoutOperator getOperator(AbstractTurnout t)
Get a TurnoutOperator instance for this operation.- Specified by:
getOperator
in classTurnoutOperation
- Parameters:
t
- the turnout to apply the operation to- Returns:
- the operator
-
getInterval
public int getInterval()
-
getMaxTries
public int getMaxTries()
-
getDefaultInterval
public abstract int getDefaultInterval()
-
getDefaultMaxTries
public abstract int getDefaultMaxTries()
-
equivalentTo
public boolean equivalentTo(TurnoutOperation other)
- Specified by:
equivalentTo
in classTurnoutOperation
- Parameters:
other
- another TurnoutOperation- Returns:
- true if the two operations are equivalent, i.e. same subclass and same parameters
-
setInterval
public void setInterval(int newInterval)
Set new value for interval. Do nothing if not in range.- Parameters:
newInterval
- new retry interval time
-
setMaxTries
public void setMaxTries(int newMaxTries)
Set new value for MaxTries. Do nothing if not in range.- Parameters:
newMaxTries
- new maximum number of retries
-
-