Package jmri
Interface ExpectedState<T,S>
-
- Type Parameters:
T- the type of object this contains the expected state forS- the type of expected state this contains
- All Known Implementing Classes:
BeanSetting,LayoutTrackExpectedState,NamedBeanExpectedState,NamedBeanExpectedValue
public interface ExpectedState<T,S>
Record an object and its expected state within a specific scenario. This can be used in collections, for example as a routing through a set of turnouts, where the turnouts and their state when all turnouts are routed for that routing can be iterated over in a single loop with reference to a single collection.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringEXPECTED_STATEConstant for the property name whensetExpectedState(java.lang.Object)fires aPropertyChangeEvent.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description SgetExpectedState()Get the expected state.TgetObject()Get the Object this records the expected state for.voidsetExpectedState(S state)Set the expected state.
-
-
-
Field Detail
-
EXPECTED_STATE
static final java.lang.String EXPECTED_STATE
Constant for the property name whensetExpectedState(java.lang.Object)fires aPropertyChangeEvent.- See Also:
- Constant Field Values
-
-
Method Detail
-
getExpectedState
S getExpectedState()
Get the expected state. This state should not change as the state of the NamedBean changes.- Returns:
- the expected state
-
setExpectedState
void setExpectedState(S state) throws java.lang.UnsupportedOperationException
Set the expected state.If UnsupportedOperationException is not thrown, this must fire a
PropertyChangeEventwith the name "expectedState"- Parameters:
state- the new expected state- Throws:
java.lang.UnsupportedOperationException- if the implementing class does not allow states to be set
-
-