|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjmri.implementation.AbstractNamedBean
jmri.implementation.AbstractSensor
public abstract class AbstractSensor
Abstract class providing the basic logic of the Sensor interface
| Field Summary | |
|---|---|
protected boolean |
_inverted
|
protected int |
_knownState
|
| Fields inherited from interface jmri.Sensor |
|---|
ACTIVE, INACTIVE |
| Fields inherited from interface jmri.NamedBean |
|---|
INCONSISTENT, UNKNOWN |
| Constructor Summary | |
|---|---|
AbstractSensor(String systemName)
|
|
AbstractSensor(String systemName,
String userName)
|
|
| Method Summary | |
|---|---|
boolean |
getInverted()
Get the inverted state. |
int |
getKnownState()
Known state on layout is a bound parameter |
int |
getState()
Implement a shorter name for getKnownState. |
void |
setInverted(boolean inverted)
Control whether the actual sensor input is considered to be inverted, e.g. the normal electrical signal that results in an ACTIVE state now results in an INACTIVE state. |
void |
setKnownState(int s)
Potentially allow the user to set the known state on the layout. |
void |
setOwnState(int s)
Set out internal state information, and notify bean listeners. |
void |
setState(int s)
Implement a shorter name for setKnownState. |
| Methods inherited from class jmri.implementation.AbstractNamedBean |
|---|
addPropertyChangeListener, dispose, firePropertyChange, getComment, getDisplayName, getNumPropertyChangeListeners, getProperty, getPropertyChangeListeners, getSystemName, getUserName, removePropertyChangeListener, setComment, setProperty, setUserName |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface jmri.Sensor |
|---|
addPropertyChangeListener, dispose, removePropertyChangeListener, requestUpdateFromLayout |
| Methods inherited from interface jmri.NamedBean |
|---|
getComment, getDisplayName, getNumPropertyChangeListeners, getProperty, getSystemName, getUserName, setComment, setProperty, setUserName |
| Field Detail |
|---|
protected boolean _inverted
protected int _knownState
| Constructor Detail |
|---|
public AbstractSensor(String systemName)
public AbstractSensor(String systemName,
String userName)
| Method Detail |
|---|
public int getKnownState()
Sensor
getKnownState in interface Sensor
public void setKnownState(int s)
throws JmriException
Sensor
setKnownState in interface SensorJmriExceptionpublic void setOwnState(int s)
public void setState(int s)
throws JmriException
This generally shouldn't be used by Java code; use setKnownState instead. The is provided to make Jython script access easier to read.
setState in interface NamedBeanJmriException - general error when cant do the needed operationpublic int getState()
This generally shouldn't be used by Java code; use getKnownState instead. The is provided to make Jython script access easier to read.
getState in interface NamedBeanpublic void setInverted(boolean inverted)
setInverted in interface Sensorpublic final boolean getInverted()
Used in polling loops in system-specific code, so made final to allow optimization.
getInverted in interface Sensor
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||