jmri
Interface Sensor

All Superinterfaces:
NamedBean
All Known Implementing Classes:
AbstractSensor, AcelaSensor, CbusSensor, LnSensor, NceSensor, RpsSensor, SerialSensor, SerialSensor, SerialSensor, SerialSensor, SerialSensor, SerialSensor, XNetSensor

public interface Sensor
extends NamedBean

General input device representation. Often subclassed for specific types of sensors.


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.

Author:
Bob Jacobsen Copyright (C) 2001

Field Summary
static int ACTIVE
           
static int INACTIVE
           
 
Fields inherited from interface jmri.NamedBean
INCONSISTENT, UNKNOWN
 
Method Summary
 void addPropertyChangeListener(PropertyChangeListener l)
          Request a call-back when the bound KnownState property changes.
 void dispose()
          Remove references to and from this object, so that it can eventually be garbage-collected.
 boolean getInverted()
          Get the inverted state.
 int getKnownState()
          Known state on layout is a bound parameter
 void removePropertyChangeListener(PropertyChangeListener l)
          Remove a request for a call-back when a bound property changes.
 void requestUpdateFromLayout()
          Request an update from the layout soft/hardware.
 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 newState)
          Potentially allow the user to set the known state on the layout.
 
Methods inherited from interface jmri.NamedBean
getComment, getNumPropertyChangeListeners, getState, getSystemName, getUserName, setComment, setState, setUserName
 

Field Detail

ACTIVE

static final int ACTIVE
See Also:
Constant Field Values

INACTIVE

static final int INACTIVE
See Also:
Constant Field Values
Method Detail

getKnownState

int getKnownState()
Known state on layout is a bound parameter

Returns:
known state value

setKnownState

void setKnownState(int newState)
                   throws JmriException
Potentially allow the user to set the known state on the layout. This might not always be available, depending on the limits of the underlying system and implementation.

Throws:
JmriException

requestUpdateFromLayout

void requestUpdateFromLayout()
Request an update from the layout soft/hardware. May not even happen, and if it does it will happen later; listen for the result.


setInverted

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.


getInverted

boolean getInverted()
Get the inverted state. If true, the electrical signal that results in an ACTIVE state now results in an INACTIVE state.


addPropertyChangeListener

void addPropertyChangeListener(PropertyChangeListener l)
Request a call-back when the bound KnownState property changes.

Specified by:
addPropertyChangeListener in interface NamedBean

removePropertyChangeListener

void removePropertyChangeListener(PropertyChangeListener l)
Remove a request for a call-back when a bound property changes.

Specified by:
removePropertyChangeListener in interface NamedBean

dispose

void dispose()
Remove references to and from this object, so that it can eventually be garbage-collected.

Specified by:
dispose in interface NamedBean


Copyright © 1997 - 2008 JMRI Community.
JMRI, DecoderPro, PanelPro, SoundPro, DispatcherPro and associated logos are our trademarks.

Additional information on copyright, trademarks and licenses is linked here.
Site hosted by: SourceForge_Logo