Package jmri.jmrix.marklin
Class MarklinReply
- java.lang.Object
-
- jmri.jmrix.AbstractMessage
-
- jmri.jmrix.AbstractMRReply
-
- jmri.jmrix.marklin.MarklinReply
-
- All Implemented Interfaces:
Message
public class MarklinReply extends AbstractMRReply
Carries the reply to an MarklinMessage.
-
-
Field Summary
-
Fields inherited from class jmri.jmrix.AbstractMRReply
DEFAULTMAXSIZE
-
Fields inherited from class jmri.jmrix.AbstractMessage
_dataChars, _nDataChars
-
-
Constructor Summary
Constructors Constructor Description MarklinReply()
MarklinReply(int[] d)
MarklinReply(java.lang.String s)
MarklinReply(MarklinReply l)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description long
getAddress()
Get the 4-Byte Address.int[]
getCanAddress()
int[]
getCanData()
int
getCanDataLength()
int
getCommand()
Get the Control Command.int
getElement(int n)
Get a particular element in a Message.int[]
getHash()
int
getPriority()
boolean
isResponse()
boolean
isUnsolicited()
Get flag for Unsolicited.int
maxSize()
void
setAddress(long address)
Sets the 4-byte address by splitting an integer into four bytes.void
setCommand(int command)
Set the Command value.protected int
skipPrefix(int index)
java.lang.String
toMonitorString()
java.lang.String
toString()
int
value()
-
Methods inherited from class jmri.jmrix.AbstractMRReply
flush, getOpCode, isBinary, isRetransmittableErrorMsg, match, pollValue, setBinary, setElement, setOpCode, setUnsolicited, skipWhiteSpace
-
Methods inherited from class jmri.jmrix.AbstractMessage
equals, getNumDataElements, hashCode
-
-
-
-
Constructor Detail
-
MarklinReply
public MarklinReply()
-
MarklinReply
public MarklinReply(java.lang.String s)
-
MarklinReply
public MarklinReply(MarklinReply l)
-
MarklinReply
public MarklinReply(int[] d)
-
-
Method Detail
-
maxSize
public int maxSize()
- Overrides:
maxSize
in classAbstractMRReply
-
skipPrefix
protected int skipPrefix(int index)
- Specified by:
skipPrefix
in classAbstractMRReply
-
value
public int value()
- Overrides:
value
in classAbstractMRReply
-
getElement
public int getElement(int n)
Description copied from class:AbstractMessage
Get a particular element in a Message.- Specified by:
getElement
in interfaceMessage
- Overrides:
getElement
in classAbstractMessage
- Parameters:
n
- Element Index.- Returns:
- single element of message.
-
isUnsolicited
public boolean isUnsolicited()
Description copied from class:AbstractMRReply
Get flag for Unsolicited.- Overrides:
isUnsolicited
in classAbstractMRReply
- Returns:
- true if Unsolicited, else false.
-
toString
public java.lang.String toString()
- Specified by:
toString
in interfaceMessage
- Overrides:
toString
in classAbstractMRReply
-
toMonitorString
public java.lang.String toMonitorString()
- Returns:
- a human-readable representation of the message.
-
isResponse
public boolean isResponse()
-
getCanDataLength
public int getCanDataLength()
-
getCanData
public int[] getCanData()
-
getCanAddress
public int[] getCanAddress()
-
getAddress
public long getAddress()
Get the 4-Byte Address.- Returns:
- the value from CANADDRESSBYTE1 (hi) to CANADDRESSBYTE4 (low)
-
setAddress
public void setAddress(long address)
Sets the 4-byte address by splitting an integer into four bytes.- Parameters:
address
- the 32-bit integer representing the full address
-
getPriority
public int getPriority()
-
getCommand
public int getCommand()
Get the Control Command.- Returns:
- command, e.g. MarklinConstants.CMDHALTSYS
-
setCommand
public void setCommand(int command)
Set the Command value.- Parameters:
command
- new value.
-
getHash
public int[] getHash()
-
-