FileDocCategorySizeDatePackage
SelectionKeyImpl.javaAPI DocAndroid 1.5 API2649Wed May 06 22:41:04 BST 2009org.apache.harmony.nio.internal

SelectionKeyImpl

public final class SelectionKeyImpl extends AbstractSelectionKey

Fields Summary
private AbstractSelectableChannel
channel
int
oldInterestOps
private int
interestOps
private int
readyOps
private SelectorImpl
selector
Constructors Summary
public SelectionKeyImpl(AbstractSelectableChannel channel, int operations, Object attachment, SelectorImpl selector)

        super();
        this.channel = channel;
        interestOps = operations;
        this.selector = selector;
        attach(attachment);
    
Methods Summary
public java.nio.channels.SelectableChannelchannel()

        return channel;
    
private voidcheckValid()

        if (!isValid()) {
            throw new CancelledKeyException();
        }
    
public intinterestOps()

        checkValid();
        synchronized (selector.keysLock) {
            return interestOps;
        }
    
public java.nio.channels.SelectionKeyinterestOps(int operations)

        checkValid();
        if ((operations & ~(channel().validOps())) != 0) {
            throw new IllegalArgumentException();
        }
        synchronized (selector.keysLock) {
            interestOps = operations;
        }
        return this;
    
public intreadyOps()

        checkValid();
        return readyOps;
    
public java.nio.channels.Selectorselector()

        return selector;
    
voidsetReadyOps(int readyOps)

        this.readyOps = readyOps;