jmri.jmrix
Class AbstractMRReply

java.lang.Object
  extended by jmri.jmrix.AbstractMessage
      extended by jmri.jmrix.AbstractMRReply
All Implemented Interfaces:
Message
Direct Known Subclasses:
AcelaReply, CanReply, EasyDccReply, GridConnectReply, MrcReply, NceReply, Reply, SerialReply, SerialReply, SerialReply, SerialReply, SerialReply, SerialReply, SerialReply, SRCPReply, XNetReply

public abstract class AbstractMRReply
extends AbstractMessage

Abstract base class for replies in a message/reply protocol.

Handles the character manipulation.

This is a variable length reply, which can grow as needed. The length is given by the largest index written so far.

Author:
Bob Jacobsen Copyright (C) 2003

Field Summary
static int DEFAULTMAXSIZE
           
 
Fields inherited from class jmri.jmrix.AbstractMessage
_dataChars, _nDataChars
 
Constructor Summary
AbstractMRReply()
           
AbstractMRReply(AbstractMRReply m)
           
AbstractMRReply(String s)
           
 
Method Summary
 void flush()
           
 int getOpCode()
           
 boolean isBinary()
           
 boolean isUnsolicited()
           
 int match(String s)
           
 int maxSize()
           
 int pollValue()
           
 void setBinary(boolean b)
           
 void setElement(int n, int v)
           
 void setOpCode(int i)
           
 void setUnsolicited()
           
protected abstract  int skipPrefix(int index)
           
 int skipWhiteSpace(int index)
           
 String toString()
           
 int value()
           
 
Methods inherited from class jmri.jmrix.AbstractMessage
getElement, getNumDataElements
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULTMAXSIZE

public static final int DEFAULTMAXSIZE
See Also:
Constant Field Values
Constructor Detail

AbstractMRReply

public AbstractMRReply()

AbstractMRReply

public AbstractMRReply(AbstractMRReply m)

AbstractMRReply

public AbstractMRReply(String s)
Method Detail

setElement

public void setElement(int n,
                       int v)
Specified by:
setElement in interface Message
Overrides:
setElement in class AbstractMessage

setOpCode

public void setOpCode(int i)

getOpCode

public int getOpCode()

flush

public void flush()

isBinary

public boolean isBinary()

setBinary

public void setBinary(boolean b)

setUnsolicited

public final void setUnsolicited()

isUnsolicited

public boolean isUnsolicited()

toString

public String toString()
Specified by:
toString in interface Message
Overrides:
toString in class Object

skipPrefix

protected abstract int skipPrefix(int index)

value

public int value()

pollValue

public int pollValue()

match

public int match(String s)

skipWhiteSpace

public int skipWhiteSpace(int index)

maxSize

public int maxSize()


Copyright © 1997 - 2008 JMRI Community.
JMRI, DecoderPro, PanelPro, SoundPro, DispatcherPro and associated logos are our trademarks.

Additional information on copyright, trademarks and licenses is linked here.
Site hosted by: SourceForge_Logo