37 |
|
|
38 |
package gnu.java.nio; |
package gnu.java.nio; |
39 |
|
|
40 |
import java.nio.channels.*; |
import java.nio.channels.SelectableChannel; |
41 |
import java.nio.channels.spi.*; |
import java.nio.channels.SelectionKey; |
42 |
|
import java.nio.channels.Selector; |
43 |
|
import java.nio.channels.spi.AbstractSelectionKey; |
44 |
|
|
45 |
public class SelectionKeyImpl extends AbstractSelectionKey |
public class SelectionKeyImpl extends AbstractSelectionKey |
46 |
{ |
{ |
47 |
int fd, ops; |
int fd, ops; |
48 |
SelectorImpl impl; |
SelectorImpl impl; |
49 |
SelectableChannel ch; |
SelectableChannel ch; |
50 |
|
|
51 |
public SelectionKeyImpl(SelectableChannel ch, |
public SelectionKeyImpl(SelectableChannel ch, SelectorImpl impl, int fd) |
52 |
SelectorImpl impl, |
{ |
53 |
int fd) |
this.ch = ch; |
54 |
{ |
this.impl = impl; |
55 |
this.ch = ch; |
this.fd = fd; |
56 |
this.impl = impl; |
} |
57 |
this.fd = fd; |
|
58 |
} |
public SelectableChannel channel () |
59 |
|
{ |
60 |
|
return ch; |
61 |
public SelectableChannel channel() |
} |
62 |
{ |
|
63 |
return ch; |
public int readyOps () |
64 |
} |
{ |
65 |
|
return 0; |
66 |
|
} |
67 |
public int readyOps() |
|
68 |
{ |
public int interestOps () |
69 |
return 0; |
{ |
70 |
} |
return ops; |
71 |
|
} |
72 |
public int interestOps() |
|
73 |
{ |
public SelectionKey interestOps (int ops) |
74 |
return ops; |
{ |
75 |
} |
this.ops = ops; |
76 |
|
return this; |
77 |
public SelectionKey interestOps(int ops) |
} |
|
{ |
|
|
this.ops = ops; |
|
|
return this; |
|
|
} |
|
78 |
|
|
79 |
public Selector selector() |
public Selector selector () |
80 |
{ |
{ |
81 |
return impl; |
return impl; |
82 |
} |
} |
83 |
} |
} |