/[classpath]/classpath/java/nio/channels/SelectionKey.java
ViewVC logotype

Diff of /classpath/java/nio/channels/SelectionKey.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by rveldema, Mon Mar 11 15:46:37 2002 UTC revision 1.2 by rveldema, Tue Mar 12 11:36:22 2002 UTC
# Line 4  package java.nio.channels; Line 4  package java.nio.channels;
4    
5  public abstract class SelectionKey  public abstract class SelectionKey
6  {  {
7      static int OP_ACCEPT  = 1<<0;      public static int OP_ACCEPT  = 1<<0;
8      static int OP_CONNECT = 1<<1;      public static int OP_CONNECT = 1<<1;
9      static int OP_READ    = 1<<2;      public static int OP_READ    = 1<<2;
10      static int OP_WRITE   = 1<<3;      public static int OP_WRITE   = 1<<3;
11            
12      Object attached;      Object attached;
13            
14  protected SelectionKey()      protected SelectionKey()
15      {      {
16      }      }
17    
18    
19      Object attach(Object obj)      public Object attach(Object obj)
20      {      {
21          Object old = attached;          Object old = attached;
22          attached = obj;          attached = obj;
23          return old;          return old;
24      }      }
25            
26      Object attachment()      public Object attachment()
27      {      {
28          return attached;          return attached;
29      }      }    
30            public boolean isAcceptable()
     boolean isAcceptable()  
31      {      {
32          return (readyOps() & OP_ACCEPT) != 0;          return (readyOps() & OP_ACCEPT) != 0;
33      }      }
34      boolean isConnectable()      public boolean isConnectable()
35      {      {
36          return (readyOps() & OP_CONNECT) != 0;            return (readyOps() & OP_CONNECT) != 0;  
37      }              }        
38      boolean isReadable()      public boolean isReadable()
39      {      {
40          return (readyOps() & OP_READ) != 0;          return (readyOps() & OP_READ) != 0;
41      }      }
42      boolean isWritable()      public boolean isWritable()
43      {      {
44          return (readyOps() & OP_WRITE) != 0;          return (readyOps() & OP_WRITE) != 0;
45      }      }
46    
47    
48      abstract  void cancel();      public abstract  void cancel();
49      abstract  SelectableChannel channel();      public abstract  SelectableChannel channel();
50      abstract  int interestOps();      public abstract  int interestOps();
51      abstract  SelectionKey interestOps(int ops);      public abstract  SelectionKey interestOps(int ops);
52      abstract  boolean isValid();      public abstract  boolean isValid();
53      abstract  int readyOps();      public abstract  int readyOps();
54      abstract  Selector selector();      public abstract  Selector selector();
55  }  }

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26