/[classpath]/classpath/gnu/java/nio/SelectionKeyImpl.java
ViewVC logotype

Diff of /classpath/gnu/java/nio/SelectionKeyImpl.java

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

revision 1.6 by mkoch, Wed May 21 12:19:29 2003 UTC revision 1.7 by mkoch, Thu Sep 25 14:01:17 2003 UTC
# Line 1  Line 1 
1  /* SelectionKeyImpl.java --  /* SelectionKeyImpl.java --
2     Copyright (C) 2002 Free Software Foundation, Inc.     Copyright (C) 2002, 2003 Free Software Foundation, Inc.
3    
4  This file is part of GNU Classpath.  This file is part of GNU Classpath.
5    
# Line 37  exception statement from your version. * Line 37  exception statement from your version. *
37    
38  package gnu.java.nio;  package gnu.java.nio;
39    
40    import java.nio.channels.CancelledKeyException;
41  import java.nio.channels.SelectableChannel;  import java.nio.channels.SelectableChannel;
42  import java.nio.channels.SelectionKey;  import java.nio.channels.SelectionKey;
43  import java.nio.channels.Selector;  import java.nio.channels.Selector;
# Line 45  import java.nio.channels.spi.AbstractSel Line 46  import java.nio.channels.spi.AbstractSel
46  public class SelectionKeyImpl extends AbstractSelectionKey  public class SelectionKeyImpl extends AbstractSelectionKey
47  {  {
48    int fd;    int fd;
49    int readyOps;    private int readyOps;
50    int interestOps;    private int interestOps;
51    SelectorImpl impl;    private SelectorImpl impl;
52    SelectableChannel ch;    private SelectableChannel ch;
53    
54    public SelectionKeyImpl (SelectableChannel ch, SelectorImpl impl, int fd)    public SelectionKeyImpl (SelectableChannel ch, SelectorImpl impl, int fd)
55    {    {
# Line 64  public class SelectionKeyImpl extends Ab Line 65  public class SelectionKeyImpl extends Ab
65    
66    public int readyOps ()    public int readyOps ()
67    {    {
68        if (!isValid())
69          throw new CancelledKeyException();
70        
71      return readyOps;      return readyOps;
72    }    }
73    
74    public SelectionKey readyOps (int ops)    public SelectionKey readyOps (int ops)
75    {    {
76        if (!isValid())
77          throw new CancelledKeyException();
78        
79      readyOps = ops;      readyOps = ops;
80      return this;      return this;
81    }    }
82    
83    public int interestOps ()    public int interestOps ()
84    {    {
85        if (!isValid())
86          throw new CancelledKeyException();
87        
88      return interestOps;          return interestOps;    
89    }    }
90    
91    public SelectionKey interestOps (int ops)    public SelectionKey interestOps (int ops)
92    {    {
93        if (!isValid())
94          throw new CancelledKeyException();
95        
96      interestOps = ops;      interestOps = ops;
97      return this;      return this;
98    }    }

Legend:
Removed from v.1.6  
changed lines
  Added in v.1.7

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