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 longgetAddress()Get the 4-Byte Address.int[]getCanAddress()int[]getCanData()intgetCanDataLength()intgetCommand()Get the Control Command.intgetElement(int n)Get a particular element in a Message.int[]getHash()intgetPriority()booleanisResponse()booleanisUnsolicited()Get flag for Unsolicited.intmaxSize()voidsetAddress(long address)Sets the 4-byte address by splitting an integer into four bytes.voidsetCommand(int command)Set the Command value.protected intskipPrefix(int index)java.lang.StringtoMonitorString()java.lang.StringtoString()intvalue()-
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:
maxSizein classAbstractMRReply
-
skipPrefix
protected int skipPrefix(int index)
- Specified by:
skipPrefixin classAbstractMRReply
-
value
public int value()
- Overrides:
valuein classAbstractMRReply
-
getElement
public int getElement(int n)
Description copied from class:AbstractMessageGet a particular element in a Message.- Specified by:
getElementin interfaceMessage- Overrides:
getElementin classAbstractMessage- Parameters:
n- Element Index.- Returns:
- single element of message.
-
isUnsolicited
public boolean isUnsolicited()
Description copied from class:AbstractMRReplyGet flag for Unsolicited.- Overrides:
isUnsolicitedin classAbstractMRReply- Returns:
- true if Unsolicited, else false.
-
toString
public java.lang.String toString()
- Specified by:
toStringin interfaceMessage- Overrides:
toStringin 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()
-
-