Package jmri.jmrix.openlcb
Class OlcbUtils
- java.lang.Object
-
- jmri.jmrix.openlcb.OlcbUtils
-
public final class OlcbUtils extends java.lang.Object
Helper functions used by multiple implementations but specific to JMRI to not go to the OpenLCB.jar.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
PROPERTY_IS_AUTHORITATIVE
static java.lang.String
PROPERTY_IS_CONSUMER
static java.lang.String
PROPERTY_IS_PRODUCER
static java.lang.String
PROPERTY_LISTEN
static java.lang.String
PROPERTY_LISTEN_INVALID
static java.lang.String
PROPERTY_QUERY_AT_STARTUP
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description (package private) static boolean
isOlcbBean(NamedBean b)
Tests whether a given NamedBead is an OpenLCB implementation.(package private) static int
overridePCFlagsFromProperties(NamedBean parent, int defaultFlags)
Checks the NamedBean properties and updates the BitProducerConsumer flags based on them.
-
-
-
Field Detail
-
PROPERTY_IS_AUTHORITATIVE
public static final java.lang.String PROPERTY_IS_AUTHORITATIVE
- See Also:
- Constant Field Values
-
PROPERTY_IS_PRODUCER
public static final java.lang.String PROPERTY_IS_PRODUCER
- See Also:
- Constant Field Values
-
PROPERTY_IS_CONSUMER
public static final java.lang.String PROPERTY_IS_CONSUMER
- See Also:
- Constant Field Values
-
PROPERTY_QUERY_AT_STARTUP
public static final java.lang.String PROPERTY_QUERY_AT_STARTUP
- See Also:
- Constant Field Values
-
PROPERTY_LISTEN
public static final java.lang.String PROPERTY_LISTEN
- See Also:
- Constant Field Values
-
PROPERTY_LISTEN_INVALID
public static final java.lang.String PROPERTY_LISTEN_INVALID
- See Also:
- Constant Field Values
-
-
Method Detail
-
overridePCFlagsFromProperties
static int overridePCFlagsFromProperties(NamedBean parent, int defaultFlags)
Checks the NamedBean properties and updates the BitProducerConsumer flags based on them.- Parameters:
parent
- NamedBean (OlcbSensor or OlcbTurnout) whose properties we'll checkdefaultFlags
- previous value of the flags.- Returns:
- new value of flags. If not property is set on the object, then == defaultFlags.
-
isOlcbBean
static boolean isOlcbBean(NamedBean b)
Tests whether a given NamedBead is an OpenLCB implementation.- Parameters:
b
- named bean object (e.g. Turnout object or Sensor object).- Returns:
- true if it is an Olcb implementation.
-
-