/[classpath]/classpath/java/nio/channels/spi/AbstractSelectionKey.java
ViewVC logotype

Diff of /classpath/java/nio/channels/spi/AbstractSelectionKey.java

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

revision 1.3 by egagnon, Sun Aug 11 20:08:43 2002 UTC revision 1.4 by mkoch, Mon Nov 11 14:25:46 2002 UTC
# Line 1  Line 1 
1  /* AbstractSelectionKey.java  /* AbstractSelectionKey.java --
2     Copyright (C) 2002 Free Software Foundation, Inc.     Copyright (C) 2002 Free Software Foundation, Inc.
3    
4  This file is part of GNU Classpath.  This file is part of GNU Classpath.
# Line 35  this exception to your version of the li Line 35  this exception to your version of the li
35  obligated to do so.  If you do not wish to do so, delete this  obligated to do so.  If you do not wish to do so, delete this
36  exception statement from your version. */  exception statement from your version. */
37    
   
38  package java.nio.channels.spi;  package java.nio.channels.spi;
39    
40  import java.nio.channels.*;  import java.nio.channels.SelectionKey;
 import java.util.*;  
   
41    
42  public abstract class AbstractSelectionKey  public abstract class AbstractSelectionKey
43      extends SelectionKey    extends SelectionKey
44  {  {
45      boolean ok = true;    boolean ok = true;
46    
47      protected AbstractSelectionKey()    protected AbstractSelectionKey ()
48      {    {
49      }    }
50    
51      public void cancel()    public final void cancel ()
52      {    {
53          if (ok)      if (ok)
54              {        {
55                  selector().cancelledKeys().add(this);          selector ().selectedKeys ().add (this);
56              }        }
57          ok = false;      
58      }      ok = false;
59      }
60      public boolean isValid()  
61      {    public final boolean isValid ()
62          return ok;    {
63      }      return ok;
64      }
65  }  }
66    

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4

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