javax.comm
Class SerialPortEvent

java.lang.Object
  extended byjava.util.EventObject
      extended byjavax.comm.SerialPortEvent
All Implemented Interfaces:
java.io.Serializable

public class SerialPortEvent
extends java.util.EventObject

A serial port event.

Author:
Jagane Sundar
See Also:
SerialPort, SerialPortEventListener, EventObject, Serialized Form

Field Summary
static int BI
          Break interrupt.
static int CD
          Carrier detect.
static int CTS
          Clear to send.
static int DATA_AVAILABLE
          Data available at the serial port.
static int DSR
          Data set ready.
 int eventType
          Deprecated. Replaced by getEventType method.
static int FE
          Framing error.
static int OE
          Overrun error.
static int OUTPUT_BUFFER_EMPTY
          Output buffer is empty.
static int PE
          Parity error.
static int RI
          Ring indicator.
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
SerialPortEvent(SerialPort srcport, int eventtype, boolean oldvalue, boolean newvalue)
          Constructs a SerialPortEvent with the specified serial port, event type, old and new values.
 
Method Summary
 int getEventType()
          Gets the type of this event.
 boolean getNewValue()
          Gets the new value of the state change that caused the SerialPortEvent to be propagated.
 boolean getOldValue()
          Gets the old value of the state change that caused the SerialPortEvent to be propagated.
 
Methods inherited from class java.util.EventObject
getSource, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

eventType

public int eventType
Deprecated. Replaced by getEventType method.

The type of event.


DATA_AVAILABLE

public static final int DATA_AVAILABLE
Data available at the serial port. This event will be generated once when new data arrive at the serial port. Even if the user doesn't read the data, it won't be generated again until next time new data arrive.

See Also:
Constant Field Values

OUTPUT_BUFFER_EMPTY

public static final int OUTPUT_BUFFER_EMPTY
Output buffer is empty. The event will be generated after a write is completed, when the system buffer becomes empty again.

See Also:
Constant Field Values

CTS

public static final int CTS
Clear to send.

See Also:
Constant Field Values

DSR

public static final int DSR
Data set ready.

See Also:
Constant Field Values

RI

public static final int RI
Ring indicator.

See Also:
Constant Field Values

CD

public static final int CD
Carrier detect.

See Also:
Constant Field Values

OE

public static final int OE
Overrun error.

See Also:
Constant Field Values

PE

public static final int PE
Parity error.

See Also:
Constant Field Values

FE

public static final int FE
Framing error.

See Also:
Constant Field Values

BI

public static final int BI
Break interrupt.

See Also:
Constant Field Values
Constructor Detail

SerialPortEvent

public SerialPortEvent(SerialPort srcport,
                       int eventtype,
                       boolean oldvalue,
                       boolean newvalue)
Constructs a SerialPortEvent with the specified serial port, event type, old and new values. Application programs should not directly create SerialPortEvent objects.

Parameters:
srcport - source parallel port
eventtype - event type
oldvalue - old value
newvalue - new value
Method Detail

getEventType

public int getEventType()
Gets the type of this event.

Returns:
integer that can be equal to one of the following static variables: BI, CD, CTS, DATA_AVAILABLE, DSR, FE, OE, OUTPUT_BUFFER_EMPTY, PE or RI.
Since:
CommAPI 1.1

getNewValue

public boolean getNewValue()
Gets the new value of the state change that caused the SerialPortEvent to be propagated. For example, when the CD bit changes, newValue reflects the new value of the CD bit.


getOldValue

public boolean getOldValue()
Gets the old value of the state change that caused the SerialPortEvent to be propagated. For example, when the CD bit changes, oldValue reflects the old value of the CD bit.