Package jmri.jmrix.dcc4pc
Class Dcc4PcReply
- java.lang.Object
-
- jmri.jmrix.AbstractMessage
-
- jmri.jmrix.AbstractMRReply
-
- jmri.jmrix.dcc4pc.Dcc4PcReply
-
- All Implemented Interfaces:
Message
public class Dcc4PcReply extends AbstractMRReply
Dcc4PcReply.java Carries the reply to a Dcc4PcMessage
-
-
Field Summary
Fields Modifier and Type Field Description (package private) boolean
error
static int
FAILED
static int
INCOMPLETE
static int
maxSize
(package private) Dcc4PcMessage
origMsg
(package private) boolean
stripRun
static int
SUCCESS
-
Fields inherited from class jmri.jmrix.AbstractMRReply
DEFAULTMAXSIZE
-
Fields inherited from class jmri.jmrix.AbstractMessage
_dataChars, _nDataChars
-
-
Constructor Summary
Constructors Constructor Description Dcc4PcReply()
Dcc4PcReply(byte[] packet)
Dcc4PcReply(java.lang.String replyString)
Dcc4PcReply(Dcc4PcReply m)
Create a new Dcc4PcReply as a deep copy of an existing Dcc4PcReply
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getBoard()
int[]
getDataAsArray()
byte[]
getFormattedReply()
int
getMessageType()
Dcc4PcMessage
getOriginalRequest()
boolean
isError()
Is this reply indicating that a general error has occurred?int
match(java.lang.String s)
Returns the index of String s in the replyint
maxSize()
void
setError(boolean boo)
protected void
setOriginalRequest(Dcc4PcMessage msg)
protected int
skipPrefix(int index)
void
strip()
java.lang.String
toHexString()
Returns a hex string representation of this Dcc4PcReply.java.lang.String
toString()
-
Methods inherited from class jmri.jmrix.AbstractMRReply
flush, getOpCode, isBinary, isRetransmittableErrorMsg, isUnsolicited, pollValue, setBinary, setElement, setOpCode, setUnsolicited, skipWhiteSpace, value
-
Methods inherited from class jmri.jmrix.AbstractMessage
equals, getElement, getNumDataElements, hashCode
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface jmri.jmrix.Message
toMonitorString
-
-
-
-
Field Detail
-
maxSize
public static final int maxSize
- See Also:
- Constant Field Values
-
error
boolean error
-
FAILED
public static final int FAILED
- See Also:
- Constant Field Values
-
INCOMPLETE
public static final int INCOMPLETE
- See Also:
- Constant Field Values
-
SUCCESS
public static final int SUCCESS
- See Also:
- Constant Field Values
-
stripRun
boolean stripRun
-
origMsg
Dcc4PcMessage origMsg
-
-
Constructor Detail
-
Dcc4PcReply
public Dcc4PcReply()
-
Dcc4PcReply
public Dcc4PcReply(byte[] packet)
-
Dcc4PcReply
public Dcc4PcReply(Dcc4PcReply m)
Create a new Dcc4PcReply as a deep copy of an existing Dcc4PcReply- Parameters:
m
- the Dcc4PcReply to copy
-
Dcc4PcReply
public Dcc4PcReply(java.lang.String replyString)
-
-
Method Detail
-
skipPrefix
protected int skipPrefix(int index)
- Specified by:
skipPrefix
in classAbstractMRReply
-
setError
public void setError(boolean boo)
-
isError
public boolean isError()
Is this reply indicating that a general error has occurred?- Returns:
- true if error, else false.
-
strip
public void strip()
-
toHexString
public java.lang.String toHexString()
Returns a hex string representation of this Dcc4PcReply.- Returns:
- hex string format of Reply using 0x format.
-
match
public int match(java.lang.String s)
Returns the index of String s in the reply- Overrides:
match
in classAbstractMRReply
-
getDataAsArray
public int[] getDataAsArray()
-
toString
public java.lang.String toString()
- Specified by:
toString
in interfaceMessage
- Overrides:
toString
in classAbstractMRReply
-
getFormattedReply
public byte[] getFormattedReply()
-
maxSize
public int maxSize()
- Overrides:
maxSize
in classAbstractMRReply
-
getOriginalRequest
public Dcc4PcMessage getOriginalRequest()
-
setOriginalRequest
protected void setOriginalRequest(Dcc4PcMessage msg)
-
getBoard
public int getBoard()
-
getMessageType
public int getMessageType()
-
-