Sun SPOT API
Green Release  


com.sun.squawk.vm
Class Channel

java.lang.Object
  extended by com.sun.squawk.vm.Channel
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
GenericConnectionChannel, GUIInputChannel, GUIOutputChannel

public abstract class Channel
extends Object
implements java.io.Serializable

The base class for the specialized channels for stream IO, graphic operations and event handling.

See Also:
Serialized Form

Field Summary
protected  ChannelIO cio
          The owner of this channel.
protected  long result
          The result of the last operation on this channel.
 
Constructor Summary
Channel(ChannelIO cio, int channelID)
          Constructor.
 
Method Summary
 void clearResult()
          Clear the result.
abstract  void close()
          Closes this channel.
 int getChannelID()
          Gets the identifier of this channel.
 int getEventNumber()
          Gets the event number used for blocking this channel.
 long getResult()
          Gets the result of the last successful operation on this channel.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

result

protected long result
The result of the last operation on this channel.


cio

protected final ChannelIO cio
The owner of this channel.

Constructor Detail

Channel

public Channel(ChannelIO cio,
               int channelID)
Constructor.

Parameters:
cio - the owner of this channel
channelID - the identifier of this channel
Method Detail

clearResult

public final void clearResult()
Clear the result.


getResult

public final long getResult()
Gets the result of the last successful operation on this channel. The value returned is undefined if the last operation on this channel was not successful or did not generate a result value.

Returns:
long the result of the last successful operation on this channel

getChannelID

public final int getChannelID()
Gets the identifier of this channel.

Returns:
the identifier of this channel

getEventNumber

public final int getEventNumber()
Gets the event number used for blocking this channel.

Returns:
the event number used for blocking this channel

close

public abstract void close()
Closes this channel.


Sun SPOT API
Green Release  


Copyright © 2006 Sun Microsystems, Inc. All Rights Reserved.