[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[cp-patches] [generics] Patch: FYI: java.nio updates
From: |
Tom Tromey |
Subject: |
[cp-patches] [generics] Patch: FYI: java.nio updates |
Date: |
24 Oct 2005 18:52:12 -0600 |
I'm checking this in on the generics branch.
This genericizes a couple of methods in java.nio and updates
gnu.java.nio to follow.
Tom
2005-10-24 Tom Tromey <address@hidden>
* gnu/java/nio/SelectorImpl.java (keys): Changed type.
(selected): Likewise.
(SelectorImpl): Updated.
(keys): Changed return type.
(getFDsAsArray): Updated.
(select): Likewise.
(selectedKeys): Changed return type.
(deregisterCancelledKeys): Updated.
* java/nio/channels/Selector.java (selectedKeys): Changed return
type.
(keys): Likewise.
Index: gnu/java/nio/SelectorImpl.java
===================================================================
RCS file: /cvsroot/classpath/classpath/gnu/java/nio/SelectorImpl.java,v
retrieving revision 1.16.2.3
diff -u -r1.16.2.3 SelectorImpl.java
--- gnu/java/nio/SelectorImpl.java 2 Aug 2005 20:12:12 -0000 1.16.2.3
+++ gnu/java/nio/SelectorImpl.java 25 Oct 2005 00:57:08 -0000
@@ -53,8 +53,8 @@
public class SelectorImpl extends AbstractSelector
{
- private Set keys;
- private Set selected;
+ private Set<SelectionKey> keys;
+ private Set<SelectionKey> selected;
/**
* A dummy object whose monitor regulates access to both our
@@ -82,8 +82,8 @@
{
super (provider);
- keys = new HashSet ();
- selected = new HashSet ();
+ keys = new HashSet<SelectionKey> ();
+ selected = new HashSet<SelectionKey> ();
}
protected void finalize() throws Throwable
@@ -109,7 +109,7 @@
}
}
- public final Set keys()
+ public final Set<SelectionKey> keys()
{
if (!isOpen())
throw new ClosedSelectorException();
@@ -135,7 +135,7 @@
{
int[] result;
int counter = 0;
- Iterator it = keys.iterator ();
+ Iterator<SelectionKey> it = keys.iterator ();
// Count the number of file descriptors needed
while (it.hasNext ())
@@ -252,7 +252,7 @@
selectThread = null;
}
- Iterator it = keys.iterator ();
+ Iterator<SelectionKey> it = keys.iterator ();
while (it.hasNext ())
{
@@ -317,7 +317,7 @@
}
}
- public final Set selectedKeys()
+ public final Set<SelectionKey> selectedKeys()
{
if (!isOpen())
throw new ClosedSelectorException();
@@ -350,10 +350,10 @@
private final void deregisterCancelledKeys()
{
- Set ckeys = cancelledKeys ();
+ Set<SelectionKey> ckeys = cancelledKeys ();
synchronized (ckeys)
{
- Iterator it = ckeys.iterator();
+ Iterator<SelectionKey> it = ckeys.iterator();
while (it.hasNext ())
{
Index: java/nio/channels/Selector.java
===================================================================
RCS file: /cvsroot/classpath/classpath/java/nio/channels/Selector.java,v
retrieving revision 1.7.2.1
diff -u -r1.7.2.1 Selector.java
--- java/nio/channels/Selector.java 2 Aug 2005 20:12:24 -0000 1.7.2.1
+++ java/nio/channels/Selector.java 25 Oct 2005 00:57:09 -0000
@@ -82,7 +82,7 @@
*
* @exception ClosedSelectorException If this selector is closed.
*/
- public abstract Set keys();
+ public abstract Set<SelectionKey> keys();
/**
* Returns the SelectorProvider that created the selector.
@@ -115,7 +115,7 @@
*
* @exception ClosedSelectorException If this selector is closed.
*/
- public abstract Set selectedKeys();
+ public abstract Set<SelectionKey> selectedKeys();
/**
* Selects a set of keys whose corresponding channels are ready
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [cp-patches] [generics] Patch: FYI: java.nio updates,
Tom Tromey <=