Package jmri.jmrix
Class AbstractMessage
java.lang.Object
jmri.jmrix.AbstractMessage
- All Implemented Interfaces:
Message
- Direct Known Subclasses:
AbstractMRMessage,AbstractMRReply,LocoNetMessage,QsiMessage,QsiReply
Base for various message implementations used by the
various abstract TrafficController classes.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCreate a new instance of AbstractMessage.AbstractMessage(int n) Create a new instance of AbstractMessage of a given byte size. -
Method Summary
Modifier and TypeMethodDescriptionbooleanEquals operator compares only base data.intgetElement(int n) Get a particular element in a Message.intGet the number of data elements in a Message.inthashCode()Hash code from base data.voidsetElement(int n, int v) Set a single Data Element at a particular index.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface jmri.jmrix.Message
toMonitorString, toString
-
Field Details
-
_dataChars
-
_nDataChars
-
-
Constructor Details
-
AbstractMessage
public AbstractMessage()Create a new instance of AbstractMessage. -
AbstractMessage
Create a new instance of AbstractMessage of a given byte size.- Parameters:
n- number of elements
-
AbstractMessage
-
AbstractMessage
-
-
Method Details
-
getElement
Get a particular element in a Message.- Specified by:
getElementin interfaceMessage- Parameters:
n- Element Index.- Returns:
- single element of message.
-
getNumDataElements
Get the number of data elements in a Message.- Specified by:
getNumDataElementsin interfaceMessage- Returns:
- number elements.
-
setElement
Set a single Data Element at a particular index.- Specified by:
setElementin interfaceMessage- Parameters:
n- index of element.v- value of element.
-
equals
Equals operator compares only base data. -
hashCode
Hash code from base data.
-