stella.io
Class SerialEvent

java.lang.Object
  extended by java.util.EventObject
      extended by util.rmi.RmiEvent
          extended by stella.io.SerialEvent
All Implemented Interfaces:
Serializable

public class SerialEvent
extends RmiEvent

An event cast by serial servers to indicate important read/write actions on the serial line. They come in two flavors, as a read and a write event. The type can be queried with the isRead() method. If checksumming was enabled on the serial line, the checksumming bytes are suppressed. The serial I/O string can be retrieved with the getSerialString() method.

See Also:
Serialized Form

Field Summary
private  boolean isread
          A boolean that indicates a read event if true.
private  String serial
          The string writtn or read in from the serial line.
 
Fields inherited from class util.rmi.RmiEvent
localHost, sourceName
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
SerialEvent(Object src, String mess)
          Constructs a new serial event with the specified serial I/O string.
SerialEvent(Object src, String mess, boolean read)
          Constructs a new serial event with the specified serial I/O string.
 
Method Summary
 String getSerialString()
          Returns the serial I/O string.
 boolean isRead()
          Returns true if this serial event belongs to a read event.
 
Methods inherited from class util.rmi.RmiEvent
getHost, getSourceName, setSourceName, toString
 
Methods inherited from class java.util.EventObject
getSource
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

serial

private String serial
The string writtn or read in from the serial line.


isread

private boolean isread
A boolean that indicates a read event if true.

Constructor Detail

SerialEvent

public SerialEvent(Object src,
                   String mess)
Constructs a new serial event with the specified serial I/O string. This constructor defaults to a write event.

Parameters:
src - The event source
mess - The string writn to or read in from the serial port.

SerialEvent

public SerialEvent(Object src,
                   String mess,
                   boolean read)
Constructs a new serial event with the specified serial I/O string. The type is explicetly specified.

Parameters:
src - The event source
mess - The string writn to or read in from the serial port.
read - True if this is a read event.
Method Detail

getSerialString

public String getSerialString()
Returns the serial I/O string. The trailing CR and the checksumming bytes are suppressed.


isRead

public boolean isRead()
Returns true if this serial event belongs to a read event.