Repository: mina Updated Branches: refs/heads/2.0 300782fcf -> 8bfffa12c
http://git-wip-us.apache.org/repos/asf/mina/blob/6f0509f7/mina-core/src/main/java/org/apache/mina/util/LazyInitializer.java ---------------------------------------------------------------------- diff --git a/mina-core/src/main/java/org/apache/mina/util/LazyInitializer.java b/mina-core/src/main/java/org/apache/mina/util/LazyInitializer.java index d4245b8..924feea 100644 --- a/mina-core/src/main/java/org/apache/mina/util/LazyInitializer.java +++ b/mina-core/src/main/java/org/apache/mina/util/LazyInitializer.java @@ -43,8 +43,7 @@ public abstract class LazyInitializer<V> { public abstract V init(); /** - * Returns the value resulting from the initialization. - * @return the initialized value + * @return the value resulting from the initialization. */ public V get() { if (value == null) { http://git-wip-us.apache.org/repos/asf/mina/blob/6f0509f7/mina-core/src/main/java/org/apache/mina/util/Log4jXmlFormatter.java ---------------------------------------------------------------------- diff --git a/mina-core/src/main/java/org/apache/mina/util/Log4jXmlFormatter.java b/mina-core/src/main/java/org/apache/mina/util/Log4jXmlFormatter.java index da2eba4..455fe0f 100644 --- a/mina-core/src/main/java/org/apache/mina/util/Log4jXmlFormatter.java +++ b/mina-core/src/main/java/org/apache/mina/util/Log4jXmlFormatter.java @@ -70,9 +70,7 @@ public class Log4jXmlFormatter extends Formatter { } /** - * Returns the current value of the <b>LocationInfo</b> option. - * - * @return whether locationInfo will be output by this layout + * @return the current value of the <b>LocationInfo</b> option. */ public boolean getLocationInfo() { return locationInfo; http://git-wip-us.apache.org/repos/asf/mina/blob/6f0509f7/mina-core/src/main/java/org/apache/mina/util/Transform.java ---------------------------------------------------------------------- diff --git a/mina-core/src/main/java/org/apache/mina/util/Transform.java b/mina-core/src/main/java/org/apache/mina/util/Transform.java index 9e3e949..ee52a20 100644 --- a/mina-core/src/main/java/org/apache/mina/util/Transform.java +++ b/mina-core/src/main/java/org/apache/mina/util/Transform.java @@ -120,8 +120,8 @@ public class Transform { } /** - * convert a Throwable into an array of Strings - * @param throwable + * Converts a Throwable into an array of Strings + * @param throwable The Throwable to convert * @return string representation of the throwable */ public static String[] getThrowableStrRep(Throwable throwable) { http://git-wip-us.apache.org/repos/asf/mina/blob/6f0509f7/mina-core/src/main/java/org/apache/mina/util/byteaccess/ByteArray.java ---------------------------------------------------------------------- diff --git a/mina-core/src/main/java/org/apache/mina/util/byteaccess/ByteArray.java b/mina-core/src/main/java/org/apache/mina/util/byteaccess/ByteArray.java index 5753ad5..78a0559 100644 --- a/mina-core/src/main/java/org/apache/mina/util/byteaccess/ByteArray.java +++ b/mina-core/src/main/java/org/apache/mina/util/byteaccess/ByteArray.java @@ -48,6 +48,8 @@ public interface ByteArray extends IoAbsoluteReader, IoAbsoluteWriter { /** * Set the byte order of the array. + * + * @param order The ByteOrder to use */ void order(ByteOrder order); @@ -58,14 +60,14 @@ public interface ByteArray extends IoAbsoluteReader, IoAbsoluteWriter { void free(); /** - * Get the sequence of <code>IoBuffer</code>s that back this array. + * @return the sequence of <code>IoBuffer</code>s that back this array. * Compared to <code>getSingleIoBuffer()</code>, this method should be * relatively efficient for all implementations. */ Iterable<IoBuffer> getIoBuffers(); /** - * Gets a single <code>IoBuffer</code> that backs this array. Some + * @return a single <code>IoBuffer</code> that backs this array. Some * implementations may initially have data split across multiple buffers, so * calling this method may require a new buffer to be allocated and * populated. @@ -76,6 +78,9 @@ public interface ByteArray extends IoAbsoluteReader, IoAbsoluteWriter { * A ByteArray is equal to another ByteArray if they start and end at the * same index, have the same byte order, and contain the same bytes at each * index. + * + * @param other The ByteArray we want to compare with + * @return <tt>true</tt> if both ByteArray are equals */ boolean equals(Object other); @@ -95,12 +100,13 @@ public interface ByteArray extends IoAbsoluteReader, IoAbsoluteWriter { int getInt(int index); /** - * Get a cursor starting at index 0 (which may not be the start of the array). + * @return a cursor starting at index 0 (which may not be the start of the array). */ Cursor cursor(); /** - * Get a cursor starting at the given index. + * @param index The starting point + * @return a cursor starting at the given index. */ Cursor cursor(int index); @@ -115,13 +121,15 @@ public interface ByteArray extends IoAbsoluteReader, IoAbsoluteWriter { interface Cursor extends IoRelativeReader, IoRelativeWriter { /** - * Gets the current index of the cursor. + * @return the current index of the cursor. */ int getIndex(); /** * Sets the current index of the cursor. No bounds checking will occur * until an access occurs. + * + * @param index The current index to set */ void setIndex(int index); http://git-wip-us.apache.org/repos/asf/mina/blob/6f0509f7/mina-core/src/main/java/org/apache/mina/util/byteaccess/ByteArrayList.java ---------------------------------------------------------------------- diff --git a/mina-core/src/main/java/org/apache/mina/util/byteaccess/ByteArrayList.java b/mina-core/src/main/java/org/apache/mina/util/byteaccess/ByteArrayList.java index 2f1afdc..6d5e312 100644 --- a/mina-core/src/main/java/org/apache/mina/util/byteaccess/ByteArrayList.java +++ b/mina-core/src/main/java/org/apache/mina/util/byteaccess/ByteArrayList.java @@ -55,22 +55,14 @@ class ByteArrayList { } /** - * - * Returns the last byte in the array list - * - * @return - * The last byte in the array list + * @return The last byte in the array list */ public int lastByte() { return lastByte; } /** - * - * Returns the first byte in the array list - * - * @return - * The first byte in the array list + * @return The first byte in the array list */ public int firstByte() { return firstByte; @@ -88,20 +80,14 @@ class ByteArrayList { } /** - * Returns the first node in the byte array - * - * @return - * + * @return the first node in the byte array */ public Node getFirst() { return header.getNextNode(); } /** - * Returns the last {@link Node} in the list - * - * @return - * The last node in the list + * @return the last {@link Node} in the list */ public Node getLast() { return header.getPreviousNode(); http://git-wip-us.apache.org/repos/asf/mina/blob/6f0509f7/mina-core/src/main/java/org/apache/mina/util/byteaccess/CompositeByteArray.java ---------------------------------------------------------------------- diff --git a/mina-core/src/main/java/org/apache/mina/util/byteaccess/CompositeByteArray.java b/mina-core/src/main/java/org/apache/mina/util/byteaccess/CompositeByteArray.java index e88a9be..4134e6e 100644 --- a/mina-core/src/main/java/org/apache/mina/util/byteaccess/CompositeByteArray.java +++ b/mina-core/src/main/java/org/apache/mina/util/byteaccess/CompositeByteArray.java @@ -44,24 +44,35 @@ public final class CompositeByteArray extends AbstractByteArray { * TODO: Is this interface right? */ public interface CursorListener { - /** * Called when the first component in the composite is entered by the cursor. + * + * @param componentIndex The component position + * @param component The component to use */ void enteredFirstComponent(int componentIndex, ByteArray component); /** * Called when the next component in the composite is entered by the cursor. + * + * @param componentIndex The component position + * @param component The component to use */ void enteredNextComponent(int componentIndex, ByteArray component); /** * Called when the previous component in the composite is entered by the cursor. + * + * @param componentIndex The component position + * @param component The component to use */ void enteredPreviousComponent(int componentIndex, ByteArray component); /** * Called when the last component in the composite is entered by the cursor. + * + * @param componentIndex The component position + * @param component The component to use */ void enteredLastComponent(int componentIndex, ByteArray component); } @@ -100,10 +111,7 @@ public final class CompositeByteArray extends AbstractByteArray { } /** - * Returns the first {@link ByteArray} in the list - * - * @return - * The first ByteArray in the list + * @return the first {@link ByteArray} in the list */ public ByteArray getFirst() { if (bas.isEmpty()) { @@ -142,6 +150,9 @@ public final class CompositeByteArray extends AbstractByteArray { * The caller is responsible for freeing the returned object. * * TODO: Document free behaviour more thoroughly. + * + * @param index The index from where we will remove bytes + * @return$ The resulting byte aaay */ public ByteArray removeTo(int index) { if (index < first() || index > last()) { @@ -341,8 +352,8 @@ public final class CompositeByteArray extends AbstractByteArray { * Get a cursor starting at index 0 (which may not be the start of the * array) and with the given listener. * - * @param listener - * Returns a new {@link ByteArray.Cursor} instance + * @param listener The listener to use + * @return a new {@link ByteArray.Cursor} instance */ public Cursor cursor(CursorListener listener) { return new CursorImpl(listener); @@ -351,10 +362,9 @@ public final class CompositeByteArray extends AbstractByteArray { /** * Get a cursor starting at the given index and with the given listener. * - * @param index - * The position of the array to start the Cursor at - * @param listener - * The listener for the Cursor that is returned + * @param index The position of the array to start the Cursor at + * @param listener The listener for the Cursor that is returned + * @return The created Cursor */ public Cursor cursor(int index, CursorListener listener) { return new CursorImpl(index, listener); http://git-wip-us.apache.org/repos/asf/mina/blob/6f0509f7/mina-core/src/main/java/org/apache/mina/util/byteaccess/CompositeByteArrayRelativeBase.java ---------------------------------------------------------------------- diff --git a/mina-core/src/main/java/org/apache/mina/util/byteaccess/CompositeByteArrayRelativeBase.java b/mina-core/src/main/java/org/apache/mina/util/byteaccess/CompositeByteArrayRelativeBase.java index 247e987..2e1be05 100644 --- a/mina-core/src/main/java/org/apache/mina/util/byteaccess/CompositeByteArrayRelativeBase.java +++ b/mina-core/src/main/java/org/apache/mina/util/byteaccess/CompositeByteArrayRelativeBase.java @@ -98,6 +98,8 @@ abstract class CompositeByteArrayRelativeBase { /** * Make a <code>ByteArray</code> available for access at the end of this object. + * + * @param ba The ByteArray to append */ public final void append(ByteArray ba) { cba.addLast(ba); @@ -111,14 +113,14 @@ abstract class CompositeByteArrayRelativeBase { } /** - * Get the index that will be used for the next access. + * @return the index that will be used for the next access. */ public final int getIndex() { return cursor.getIndex(); } /** - * Get the index after the last byte that can be accessed. + * @return the index after the last byte that can be accessed. */ public final int last() { return cba.last(); http://git-wip-us.apache.org/repos/asf/mina/blob/6f0509f7/mina-core/src/main/java/org/apache/mina/util/byteaccess/CompositeByteArrayRelativeReader.java ---------------------------------------------------------------------- diff --git a/mina-core/src/main/java/org/apache/mina/util/byteaccess/CompositeByteArrayRelativeReader.java b/mina-core/src/main/java/org/apache/mina/util/byteaccess/CompositeByteArrayRelativeReader.java index f49dee2..742c016 100644 --- a/mina-core/src/main/java/org/apache/mina/util/byteaccess/CompositeByteArrayRelativeReader.java +++ b/mina-core/src/main/java/org/apache/mina/util/byteaccess/CompositeByteArrayRelativeReader.java @@ -75,7 +75,7 @@ public class CompositeByteArrayRelativeReader extends CompositeByteArrayRelative } /** - * Returns the byte at the current position in the buffer + * @return the byte at the current position in the buffer * */ public byte get() { http://git-wip-us.apache.org/repos/asf/mina/blob/6f0509f7/mina-core/src/main/java/org/apache/mina/util/byteaccess/CompositeByteArrayRelativeWriter.java ---------------------------------------------------------------------- diff --git a/mina-core/src/main/java/org/apache/mina/util/byteaccess/CompositeByteArrayRelativeWriter.java b/mina-core/src/main/java/org/apache/mina/util/byteaccess/CompositeByteArrayRelativeWriter.java index 9eaddc7..e24c678 100644 --- a/mina-core/src/main/java/org/apache/mina/util/byteaccess/CompositeByteArrayRelativeWriter.java +++ b/mina-core/src/main/java/org/apache/mina/util/byteaccess/CompositeByteArrayRelativeWriter.java @@ -145,6 +145,8 @@ public class CompositeByteArrayRelativeWriter extends CompositeByteArrayRelative /** * Flush to the given index. + * + * @param index The end position */ public void flushTo(int index) { ByteArray removed = cba.removeTo(index); http://git-wip-us.apache.org/repos/asf/mina/blob/6f0509f7/mina-core/src/main/java/org/apache/mina/util/byteaccess/IoAbsoluteReader.java ---------------------------------------------------------------------- diff --git a/mina-core/src/main/java/org/apache/mina/util/byteaccess/IoAbsoluteReader.java b/mina-core/src/main/java/org/apache/mina/util/byteaccess/IoAbsoluteReader.java index 2c76c70..c1c17e1 100644 --- a/mina-core/src/main/java/org/apache/mina/util/byteaccess/IoAbsoluteReader.java +++ b/mina-core/src/main/java/org/apache/mina/util/byteaccess/IoAbsoluteReader.java @@ -31,67 +31,81 @@ import org.apache.mina.core.buffer.IoBuffer; public interface IoAbsoluteReader { /** - * Get the index of the first byte that can be accessed. + * @return the index of the first byte that can be accessed. */ int first(); /** - * Gets the index after the last byte that can be accessed. + * @return the index after the last byte that can be accessed. */ int last(); /** - * Gets the total number of bytes that can be accessed. + * @return the total number of bytes that can be accessed. */ int length(); /** * Creates an array with a view of part of this array. + * + * @param index The starting position + * @param length The number of bytes to copy + * @return The ByteArray that is a view on the original array */ ByteArray slice(int index, int length); /** - * Gets the order of the bytes. + * @return the order of the bytes. */ ByteOrder order(); /** - * Gets a <code>byte</code> from the given index. + * @param index The starting position + * @return a <tt>byte</tt> from the given index. */ byte get(int index); /** - * Gets enough bytes to fill the <code>IoBuffer</code> from the given index. + * Gets enough bytes to fill the <tt>IoBuffer</tt> from the given index. + * + * @param index The starting position + * @param bb The IoBuffer that will be filled with the bytes */ void get(int index, IoBuffer bb); /** - * Gets a <code>short</code> from the given index. + * @param index The starting position + * @return a <tt>short</tt> from the given index. */ short getShort(int index); /** - * Gets an <code>int</code> from the given index. + * @param index The starting position + * @return an <tt>int</tt> from the given index. */ int getInt(int index); /** - * Gets a <code>long</code> from the given index. + * @param index The starting position + * @return a <tt>long</tt> from the given index. */ long getLong(int index); /** - * Gets a <code>float</code> from the given index. + * @param index The starting position + * @return a <tt>float</tt> from the given index. */ float getFloat(int index); /** - * Gets a <code>double</code> from the given index. + * @param index The starting position + * @return a <tt>double</tt> from the given index. */ double getDouble(int index); /** - * Gets a <code>char</code> from the given index. + * @param index The starting position + * @return a <tt>char</tt> from the given index. */ char getChar(int index); } http://git-wip-us.apache.org/repos/asf/mina/blob/6f0509f7/mina-core/src/main/java/org/apache/mina/util/byteaccess/IoAbsoluteWriter.java ---------------------------------------------------------------------- diff --git a/mina-core/src/main/java/org/apache/mina/util/byteaccess/IoAbsoluteWriter.java b/mina-core/src/main/java/org/apache/mina/util/byteaccess/IoAbsoluteWriter.java index cfaa379..db3fd99 100644 --- a/mina-core/src/main/java/org/apache/mina/util/byteaccess/IoAbsoluteWriter.java +++ b/mina-core/src/main/java/org/apache/mina/util/byteaccess/IoAbsoluteWriter.java @@ -31,57 +31,81 @@ import org.apache.mina.core.buffer.IoBuffer; public interface IoAbsoluteWriter { /** - * Get the index of the first byte that can be accessed. + * @return the index of the first byte that can be accessed. */ int first(); /** - * Gets the index after the last byte that can be accessed. + * @return the index after the last byte that can be accessed. */ int last(); /** - * Gets the order of the bytes. + * @return the order of the bytes. */ ByteOrder order(); /** * Puts a <code>byte</code> at the given index. + * + * @param index The position + * @param b The byte to put */ void put(int index, byte b); /** * Puts bytes from the <code>IoBuffer</code> at the given index. + * + * @param index The position + * @param bb The bytes to put */ void put(int index, IoBuffer bb); /** * Puts a <code>short</code> at the given index. + * + * @param index The position + * @param s The short to put */ void putShort(int index, short s); /** * Puts an <code>int</code> at the given index. + * + * @param index The position + * @param i The int to put */ void putInt(int index, int i); /** * Puts a <code>long</code> at the given index. + * + * @param index The position + * @param l The long to put */ void putLong(int index, long l); /** * Puts a <code>float</code> at the given index. + * + * @param index The position + * @param f The float to put */ void putFloat(int index, float f); /** * Puts a <code>double</code> at the given index. + * + * @param index The position + * @param d The doubvle to put */ void putDouble(int index, double d); /** * Puts a <code>char</code> at the given index. + * + * @param index The position + * @param c The char to put */ void putChar(int index, char c); } http://git-wip-us.apache.org/repos/asf/mina/blob/6f0509f7/mina-core/src/main/java/org/apache/mina/util/byteaccess/IoRelativeReader.java ---------------------------------------------------------------------- diff --git a/mina-core/src/main/java/org/apache/mina/util/byteaccess/IoRelativeReader.java b/mina-core/src/main/java/org/apache/mina/util/byteaccess/IoRelativeReader.java index 94d59e3..51aab62 100644 --- a/mina-core/src/main/java/org/apache/mina/util/byteaccess/IoRelativeReader.java +++ b/mina-core/src/main/java/org/apache/mina/util/byteaccess/IoRelativeReader.java @@ -31,67 +31,74 @@ import org.apache.mina.core.buffer.IoBuffer; public interface IoRelativeReader { /** - * Gets the number of remaining bytes that can be read. + * @return the number of remaining bytes that can be read. */ int getRemaining(); /** * Checks if there are any remaining bytes that can be read. + * + * @return <tt>true</tt> if there are some remaining bytes in the buffer */ boolean hasRemaining(); /** * Advances the reader by the given number of bytes. + * + * @param length the number of bytes to skip */ void skip(int length); /** - * Creates an array with a view of part of this array. + * @param length The number of bytes to get + * @return an array with a view of part of this array. */ ByteArray slice(int length); /** - * Gets the order of the bytes. + * @return the bytes' order */ ByteOrder order(); /** - * Gets a <code>byte</code> and advances the reader. + * @return the <code>byte</code> at the current position and advances the reader. */ byte get(); /** * Gets enough bytes to fill the <code>IoBuffer</code> and advances the reader. + * + * @param bb The IoBuffer that will contain the read bytes */ void get(IoBuffer bb); /** - * Gets a <code>short</code> and advances the reader. + * @return a <code>short</code> and advances the reader. */ short getShort(); /** - * Gets an <code>int</code> and advances the reader. + * @return an <code>int</code> and advances the reader. */ int getInt(); /** - * Gets a <code>long</code> and advances the reader. + * @return a <code>long</code> and advances the reader. */ long getLong(); /** - * Gets a <code>float</code> and advances the reader. + * @return a <code>float</code> and advances the reader. */ float getFloat(); /** - * Gets a <code>double</code> and advances the reader. + * @return a <code>double</code> and advances the reader. */ double getDouble(); /** - * Gets a <code>char</code> and advances the reader. + * @return a <code>char</code> and advances the reader. */ char getChar(); } http://git-wip-us.apache.org/repos/asf/mina/blob/6f0509f7/mina-core/src/main/java/org/apache/mina/util/byteaccess/IoRelativeWriter.java ---------------------------------------------------------------------- diff --git a/mina-core/src/main/java/org/apache/mina/util/byteaccess/IoRelativeWriter.java b/mina-core/src/main/java/org/apache/mina/util/byteaccess/IoRelativeWriter.java index a645674..1c6d6b9 100644 --- a/mina-core/src/main/java/org/apache/mina/util/byteaccess/IoRelativeWriter.java +++ b/mina-core/src/main/java/org/apache/mina/util/byteaccess/IoRelativeWriter.java @@ -31,62 +31,80 @@ import org.apache.mina.core.buffer.IoBuffer; public interface IoRelativeWriter { /** - * Gets the number of remaining bytes that can be read. + * @return the number of remaining bytes that can be read. */ int getRemaining(); /** - * Checks if there are any remaining bytes that can be read. + * @return if there are any remaining bytes that can be read. */ boolean hasRemaining(); /** * Advances the writer by the given number of bytes. + * + * @param length The number of bytes to skip */ void skip(int length); /** - * Gets the order of the bytes. + * @return the bytes' order */ ByteOrder order(); /** * Puts a <code>byte</code> and advances the reader. + * + * @param b The byte to put */ void put(byte b); /** * Puts enough bytes to fill the <code>IoBuffer</code> and advances the reader. + * + * @param bb The bytes to put */ void put(IoBuffer bb); /** * Puts a <code>short</code> and advances the reader. + * + * @param s The short to put */ void putShort(short s); /** * Puts an <code>int</code> and advances the reader. + * + * @param i The int to put */ void putInt(int i); /** * Puts a <code>long</code> and advances the reader. + * + * @param l The long to put */ void putLong(long l); /** * Puts a <code>float</code> and advances the reader. + * + * @param f The float to put */ void putFloat(float f); /** * Puts a <code>double</code> and advances the reader. + * + * @param d The double to put */ void putDouble(double d); /** * Puts a <code>char</code> and advances the reader. + * + * @param c The char to put */ void putChar(char c); }
