harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ghar...@apache.org
Subject svn commit: r419256 - /incubator/harmony/enhanced/classlib/trunk/modules/nio/src/main/java/java/nio/channels/Pipe.java
Date Wed, 05 Jul 2006 15:34:21 GMT
Author: gharley
Date: Wed Jul  5 08:34:21 2006
New Revision: 419256

URL: http://svn.apache.org/viewvc?rev=419256&view=rev
Log:
HARMONY 761 : [nio] Javadoc for java.nio.channels.Pipe is missing

Modified:
    incubator/harmony/enhanced/classlib/trunk/modules/nio/src/main/java/java/nio/channels/Pipe.java

Modified: incubator/harmony/enhanced/classlib/trunk/modules/nio/src/main/java/java/nio/channels/Pipe.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/nio/src/main/java/java/nio/channels/Pipe.java?rev=419256&r1=419255&r2=419256&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/nio/src/main/java/java/nio/channels/Pipe.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/nio/src/main/java/java/nio/channels/Pipe.java
Wed Jul  5 08:34:21 2006
@@ -1,4 +1,4 @@
-/* Copyright 2005 The Apache Software Foundation or its licensors, as applicable
+/* Copyright 2005,2006 The Apache Software Foundation or its licensors, as applicable
  * 
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -15,53 +15,103 @@
 
 package java.nio.channels;
 
-
 import java.io.IOException;
 import java.nio.channels.spi.AbstractSelectableChannel;
 import java.nio.channels.spi.SelectorProvider;
 
 /**
- * TODO Type description
+ * A pipe contains two channels. One is the writable sink channel and the other is
+ * readable source channel. When bytes are written into the writable channel they
+ * can be read from readable channel. The order of these bytes remains unchanged. 
  * 
  */
 public abstract class Pipe {
 
-	public static abstract class SinkChannel extends AbstractSelectableChannel
-			implements WritableByteChannel, GatheringByteChannel {
-		protected SinkChannel(SelectorProvider provider) {
-			super(provider);
-		}
-
-		public final int validOps() {
-			return SelectionKey.OP_WRITE;
-		}
-
-	}
-
-	public static abstract class SourceChannel extends
-			AbstractSelectableChannel implements ReadableByteChannel,
-			ScatteringByteChannel {
-
-		protected SourceChannel(SelectorProvider provider) {
-			super(provider);
-		}
-
-		public final int validOps() {
-			return SelectionKey.OP_READ;
-		}
-
-	}
-
-	public static Pipe open() throws IOException {
-		return SelectorProvider.provider().openPipe();
-	}
-
-	protected Pipe() {
-		super();
-	}
-
-	public abstract SinkChannel sink();
-
-	public abstract SourceChannel source();
+    /**
+     * Writable sink channel for writing into.
+     */
+    public static abstract class SinkChannel extends AbstractSelectableChannel
+            implements WritableByteChannel, GatheringByteChannel {
+        
+        /**
+         * The Constructor.
+         * 
+         * @param provider
+         *            the provider of the channel
+         */
+        protected SinkChannel(SelectorProvider provider) {
+            super(provider);
+        }
+
+        /**
+         * Indicates this channel supports only writing.
+         * 
+         * @return a static value of OP_WRITE
+         */
+        public final int validOps() {
+            return SelectionKey.OP_WRITE;
+        }
+    }
+
+    /**
+     * Readable source channel for reading from.
+     */
+    public static abstract class SourceChannel extends
+            AbstractSelectableChannel implements ReadableByteChannel,
+            ScatteringByteChannel {
+        
+        /**
+         * The Constructor.
+         * 
+         * @param provider
+         *            the provider of the channel
+         */
+        protected SourceChannel(SelectorProvider provider) {
+            super(provider);
+        }
+
+        /**
+         * Indicates this channel supports only reading.
+         * 
+         * @return a static value of OP_READ
+         */
+        public final int validOps() {
+            return SelectionKey.OP_READ;
+        }
+
+    }
+
+    /**
+     * Initializes a pipe.
+     * 
+     * @return a new instance of pipe
+     * 
+     * @throws IOException
+     *             if I/O error occurs
+     */
+    public static Pipe open() throws IOException {
+        return SelectorProvider.provider().openPipe();
+    }
+
+    /**
+     * The protected constructor.
+     */
+    protected Pipe() {
+        super();
+    }
+
+    /**
+     * Returns the sink channel of the pipe.
+     * 
+     * @return a writable sink channel of the pipe
+     */
+    public abstract SinkChannel sink();
+
+    /**
+     * Returns the source channel of the pipe.
+     * 
+     * @return a readable source channel of the pipe
+     */
+    public abstract SourceChannel source();
 
 }



Mime
View raw message