You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by mt...@apache.org on 2009/06/19 13:01:05 UTC
svn commit: r786452 - in /commons/sandbox/runtime/trunk/src/main:
java/org/apache/commons/runtime/Structure.java native/shared/structure.c
Author: mturk
Date: Fri Jun 19 11:01:05 2009
New Revision: 786452
URL: http://svn.apache.org/viewvc?rev=786452&view=rev
Log:
Update javadocs
Modified:
commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/Structure.java
commons/sandbox/runtime/trunk/src/main/native/shared/structure.c
Modified: commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/Structure.java
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/Structure.java?rev=786452&r1=786451&r2=786452&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/Structure.java (original)
+++ commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/Structure.java Fri Jun 19 11:01:05 2009
@@ -25,18 +25,6 @@
public abstract class Structure
{
- /**
- * Compares this {@code Structure} to the specified object.
- *
- * @param other a {@code Structure}
- * @return true if the class of this {@code Structure} object and the
- * class of {@code other} are exactly equal, and the C/C++
- * pointers being pointed to by these objects are also
- * equal. Returns false otherwise.
- */
- @Override
- public abstract boolean equals(Object other);
-
/*
* Structure can only be created from Pointer class.
*/
@@ -46,9 +34,9 @@
}
/**
- * Get a size of this {@code structure}.
+ * Get the size of this {@code structure}.
*
- * @return {@code int} representing the size.
+ * @return {@code int} representing the structure size.
*/
public abstract int sizeof();
@@ -58,24 +46,69 @@
*
* @return a {@code byte} at {@code index}.
* @throws IndexOutOfBoundsException if {@code index} would cause access
- * outside the pointer address space.
- * @throws NullPointerException if pointer is {@code null}.
+ * outside the structure address space.
+ * @throws NullPointerException if structure pointer is {@code null}.
*/
public abstract int peek(int index)
throws IndexOutOfBoundsException, NullPointerException;
+ /**
+ * Get a {@code short} value this {@code structure} contains at the
+ * {@code index}.
+ *
+ * @return a {@code short} at {@code index}.
+ * @throws IndexOutOfBoundsException if {@code index} would cause access
+ * outside the structure address space.
+ * @throws NullPointerException if structure pointer is {@code null}.
+ */
public abstract int peek16(int index)
throws IndexOutOfBoundsException, NullPointerException;
+ /**
+ * Get a {@code int} value this {@code structure} contains at the
+ * {@code index}.
+ *
+ * @return a {@code integer} at {@code index}.
+ * @throws IndexOutOfBoundsException if {@code index} would cause access
+ * outside the structure address space.
+ * @throws NullPointerException if structure pointer is {@code null}.
+ */
public abstract int peek32(int index)
throws IndexOutOfBoundsException, NullPointerException;
+ /**
+ * Get a {@code long} value this {@code structure} contains at the
+ * {@code index}.
+ *
+ * @return a {@code long} at {@code index}.
+ * @throws IndexOutOfBoundsException if {@code index} would cause access
+ * outside the structure address space.
+ * @throws NullPointerException if structure pointer is {@code null}.
+ */
public abstract long peek64(int index)
throws IndexOutOfBoundsException, NullPointerException;
+ /**
+ * Get a {@code float} value this {@code structure} contains at the
+ * {@code index}.
+ *
+ * @return a {@code float} at {@code index}.
+ * @throws IndexOutOfBoundsException if {@code index} would cause access
+ * outside the structure address space.
+ * @throws NullPointerException if structure pointer is {@code null}.
+ */
public abstract float peek32f(int index)
throws IndexOutOfBoundsException, NullPointerException;
+ /**
+ * Get a {@code double} value this {@code structure} contains at the
+ * {@code index}.
+ *
+ * @return a {@code double} at {@code index}.
+ * @throws IndexOutOfBoundsException if {@code index} would cause access
+ * outside the structure address space.
+ * @throws NullPointerException if structure pointer is {@code null}.
+ */
public abstract double peek64f(int index)
throws IndexOutOfBoundsException, NullPointerException;
@@ -85,32 +118,89 @@
*
* @param value Value to set at {@code index}.
* @throws IndexOutOfBoundsException if {@code index} would cause access
- * outside the pointer address space.
+ * outside the structure address space.
* @throws NullPointerException if pointer is {@code null}.
*/
public abstract void poke(int index, int value)
throws IndexOutOfBoundsException, NullPointerException;
+ /**
+ * Set a {@code short} value to this {@code structure} at the
+ * {@code index} location.
+ *
+ * @param value Value to set at {@code index}.
+ * @throws IndexOutOfBoundsException if {@code index} would cause access
+ * outside the structure address space.
+ * @throws NullPointerException if pointer is {@code null}.
+ */
public abstract void poke16(int index, int value)
throws IndexOutOfBoundsException, NullPointerException;
+ /**
+ * Set a {@code integer} value to this {@code structure} at the
+ * {@code index} location.
+ *
+ * @param value Value to set at {@code index}.
+ * @throws IndexOutOfBoundsException if {@code index} would cause access
+ * outside the structure address space.
+ * @throws NullPointerException if pointer is {@code null}.
+ */
public abstract void poke32(int index, int value)
throws IndexOutOfBoundsException, NullPointerException;
+ /**
+ * Set a {@code float} value to this {@code structure} at the
+ * {@code index} location.
+ *
+ * @param value Value to set at {@code index}.
+ * @throws IndexOutOfBoundsException if {@code index} would cause access
+ * outside the structure address space.
+ * @throws NullPointerException if pointer is {@code null}.
+ */
public abstract void poke32(int index, float value)
throws IndexOutOfBoundsException, NullPointerException;
+ /**
+ * Set a {@code long} value to this {@code structure} at the
+ * {@code index} location.
+ *
+ * @param value Value to set at {@code index}.
+ * @throws IndexOutOfBoundsException if {@code index} would cause access
+ * outside the structure address space.
+ * @throws NullPointerException if pointer is {@code null}.
+ */
public abstract void poke64(int index, long value)
throws IndexOutOfBoundsException, NullPointerException;
+ /**
+ * Set a {@code double} value to this {@code structure} at the
+ * {@code index} location.
+ *
+ * @param value Value to set at {@code index}.
+ * @throws IndexOutOfBoundsException if {@code index} would cause access
+ * outside the structure address space.
+ * @throws NullPointerException if pointer is {@code null}.
+ */
public abstract void poke64(int index, double value)
throws IndexOutOfBoundsException, NullPointerException;
/**
+ * Compares this {@code Structure} to the specified object.
+ *
+ * @param other a {@code Structure}
+ * @return true if the class of this {@code Structure} object and the
+ * class of {@code other} are exactly equal, and the C/C++
+ * pointers being pointed to by these objects are also
+ * equal. Returns false otherwise.
+ */
+ @Override
+ public abstract boolean equals(Object other);
+
+ /**
* Returns a string representation of the Structure.
* The returned string is hexadecimal representation of the underlying
* pointer.
- * @return a hexadecimal representation of the pointer.
+ * @return a hexadecimal representation of the structure.
*/
@Override
public abstract String toString();
Modified: commons/sandbox/runtime/trunk/src/main/native/shared/structure.c
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/shared/structure.c?rev=786452&r1=786451&r2=786452&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/shared/structure.c (original)
+++ commons/sandbox/runtime/trunk/src/main/native/shared/structure.c Fri Jun 19 11:01:05 2009
@@ -48,7 +48,7 @@
{
UNREFERENCED_STDARGS;
- return *(N2P(a, short *));
+ return *(N2P(a, jchar *));
}
ACR_STR_EXPORT_DECLARE(jint, peek2)(ACR_JNISTDARGS, jniptr a)