harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From telli...@apache.org
Subject svn commit: r787256 - in /harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/platform: IMemorySystem.java OSNetworkSystem.java
Date Mon, 22 Jun 2009 14:42:42 GMT
Author: tellison
Date: Mon Jun 22 14:42:41 2009
New Revision: 787256

URL: http://svn.apache.org/viewvc?rev=787256&view=rev
Log:
Some javadoc updates.

Modified:
    harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/platform/IMemorySystem.java
    harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/platform/OSNetworkSystem.java

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/platform/IMemorySystem.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/platform/IMemorySystem.java?rev=787256&r1=787255&r2=787256&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/platform/IMemorySystem.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/platform/IMemorySystem.java
Mon Jun 22 14:42:41 2009
@@ -26,11 +26,23 @@
  */
 public interface IMemorySystem {
 
-	public final int MMAP_READ_ONLY = 1;
-
-	public final int MMAP_READ_WRITE = 2;
-
-	public final int MMAP_WRITE_COPY = 4;
+    /**
+     * The constant representing read-only access to data in a memory map
+     * request.
+     */
+    public final int MMAP_READ_ONLY = 1;
+
+    /**
+     * The constant representing read-write access to data in a memory map
+     * request.
+     */
+    public final int MMAP_READ_WRITE = 2;
+
+    /**
+     * The constant representing copy-on-write access to data in a memory map
+     * request.
+     */
+    public final int MMAP_WRITE_COPY = 4;
 
 	/**
 	 * Answers true if the platform is little endian, otherwise it may be
@@ -173,7 +185,17 @@
 	public void setByteArray(long address, byte[] bytes, int offset, int length)
 			throws NullPointerException, IndexOutOfBoundsException;
 
-	// Primitive get & set methods
+    /**
+     * Returns the value of a single byte at the given address.
+     * <p>
+     * The behavior is unspecified if <code>address</code> is not in the range
+     * that was previously allocated using <code>malloc()</code>.
+     * </p>
+     * 
+     * @param address
+     *            the address at which to get the byte value.
+     * @return the value of the byte.
+     */
 	public byte getByte(long address);
 
 	/**
@@ -205,6 +227,21 @@
 	 */
 	public short getShort(long address);
 
+    /**
+     * Gets the value of the signed two-byte integer stored in the given byte
+     * order at the given address.
+     * <p>
+     * The behavior is unspecified if <code>(address ... address + 2)</code>
is
+     * not wholly within the range that was previously allocated using
+     * <code>malloc()</code>.
+     * </p>
+     * 
+     * @param address
+     *            the platform address of the start of the two-byte value.
+     * @param endianness
+     *            the required interpretation of the short endianness.
+     * @return the value of the two-byte integer as a Java <code>short</code>.
+     */
 	public short getShort(long address, Endianness endianness);
 
 	/**
@@ -404,17 +441,25 @@
 	public void setAddress(long address, long value);
 
 	/**
-	 * TODO: JavaDoc
-	 * 
-	 * @param fileDescriptor
-	 * @param alignment
-	 * @param size
-	 * @param mapMode
-	 * @return
-	 * @throws IOException
-	 */
-	public long mmap(long fileDescriptor, long alignment, long size,
-			int mapMode) throws IOException;
+     * Map file content into memory.
+     * 
+     * @param fileDescriptor
+     *            a handle to the file that is to be memory mapped.
+     * @param alignment
+     *            the offset in the file where the mapping should begin.
+     * @param size
+     *            the number of bytes that are requested to map.
+     * @param mapMode
+     *            the desired access mode as defined by one of the constants
+     *            {@link IMemorySystem#MMAP_READ_ONLY},
+     *            {@link IMemorySystem#MMAP_READ_WRITE},
+     *            {@link IMemorySystem#MMAP_WRITE_COPY}
+     * @return the start address of the mapped memory area.
+     * @throws IOException
+     *             if an exception occurs mapping the file into memory.
+     */
+    public long mmap(long fileDescriptor, long alignment, long size, int mapMode)
+            throws IOException;
 
 	/**
 	 * TODO: JavaDoc

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/platform/OSNetworkSystem.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/platform/OSNetworkSystem.java?rev=787256&r1=787255&r2=787256&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/platform/OSNetworkSystem.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/platform/OSNetworkSystem.java
Mon Jun 22 14:42:41 2009
@@ -346,8 +346,8 @@
      *            all sockets interested in write and connect
      * @param timeout
      *            timeout in milliseconds
-     * @returns each element describes the corresponding state of the descriptor
-     *          in the read and write arrays.
+     * @return each element describes the corresponding state of the descriptor
+     *         in the read and write arrays.
      * @throws SocketException
      */
     public int[] select(FileDescriptor[] readFDs, FileDescriptor[] writeFDs,



Mime
View raw message