From 6cb33f75abd27f17272f79f7c7a23ff0efc15ce4 Mon Sep 17 00:00:00 2001 From: Peter Reilly Date: Mon, 6 Dec 2004 09:28:40 +0000 Subject: [PATCH] Minor corrections plus added @param and @return where missing Obtained from: Kevin Jackson git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@277123 13f79535-47bb-0310-9956-ffa450edef68 --- src/main/org/apache/tools/zip/ZipLong.java | 20 +++++++++++++------- src/main/org/apache/tools/zip/ZipShort.java | 13 ++++++++++--- 2 files changed, 23 insertions(+), 10 deletions(-) diff --git a/src/main/org/apache/tools/zip/ZipLong.java b/src/main/org/apache/tools/zip/ZipLong.java index d592db39b..6eb6cfede 100644 --- a/src/main/org/apache/tools/zip/ZipLong.java +++ b/src/main/org/apache/tools/zip/ZipLong.java @@ -29,6 +29,7 @@ public final class ZipLong implements Cloneable { /** * Create instance from a number. + * @param value the long to store as a ZipLong * @since 1.1 */ public ZipLong(long value) { @@ -37,6 +38,7 @@ public final class ZipLong implements Cloneable { /** * Create instance from bytes. + * @param bytes the bytes to store as a ZipLong * @since 1.1 */ public ZipLong (byte[] bytes) { @@ -45,6 +47,8 @@ public final class ZipLong implements Cloneable { /** * Create instance from the four bytes starting at offset. + * @param bytes the bytes to store as a ZipLong + * @param offset the offset to start * @since 1.1 */ public ZipLong (byte[] bytes, int offset) { @@ -54,14 +58,16 @@ public final class ZipLong implements Cloneable { /** * Get value as four bytes in big endian byte order. * @since 1.1 + * @return value as four bytes in big endian order */ public byte[] getBytes() { return ZipLong.getBytes(value); } /** - * Get value as Java int. + * Get value as Java long. * @since 1.1 + * @return value as a long */ public long getValue() { return value; @@ -82,10 +88,10 @@ public final class ZipLong implements Cloneable { } /** - * Helper method to get the value as a java long from four bytes starting at given array offset + * Helper method to get the value as a Java long from four bytes starting at given array offset * @param bytes the array of bytes * @param offset the offset to start - * @return the correspondanding java int value + * @return the correspondanding Java long value */ public static long getValue(byte[] bytes, int offset){ long value = (bytes[offset + 3] << 24) & 0xFF000000L; @@ -96,9 +102,9 @@ public final class ZipLong implements Cloneable { } /** - * Helper method to get the value as a java long from a four-byte array + * Helper method to get the value as a Java long from a four-byte array * @param bytes the array of bytes - * @return the correspondanding java long value + * @return the correspondanding Java long value */ public static long getValue(byte[] bytes){ return getValue(bytes, 0); @@ -106,7 +112,7 @@ public final class ZipLong implements Cloneable { /** * Override to make two instances with same value equal. - * + * @param o an object to compare * @since 1.1 */ public boolean equals(Object o) { @@ -118,7 +124,7 @@ public final class ZipLong implements Cloneable { /** * Override to make two instances with same value equal. - * + * @return the value stored in the ZipLong * @since 1.1 */ public int hashCode() { diff --git a/src/main/org/apache/tools/zip/ZipShort.java b/src/main/org/apache/tools/zip/ZipShort.java index f272c0c7c..fee9181ff 100644 --- a/src/main/org/apache/tools/zip/ZipShort.java +++ b/src/main/org/apache/tools/zip/ZipShort.java @@ -29,7 +29,7 @@ public final class ZipShort implements Cloneable { /** * Create instance from a number. - * + * @param value the int to store as a ZipShort * @since 1.1 */ public ZipShort (int value) { @@ -38,6 +38,7 @@ public final class ZipShort implements Cloneable { /** * Create instance from bytes. + * @param bytes the bytes to store as a ZipShort * @since 1.1 */ public ZipShort (byte[] bytes) { @@ -46,6 +47,8 @@ public final class ZipShort implements Cloneable { /** * Create instance from the two bytes starting at offset. + * @param bytes the bytes to store as a ZipShort + * @param offset the offset to start * @since 1.1 */ public ZipShort (byte[] bytes, int offset) { @@ -54,6 +57,7 @@ public final class ZipShort implements Cloneable { /** * Get value as two bytes in big endian byte order. + * @return the value as a a two byte array in big endian byte order * @since 1.1 */ public byte[] getBytes() { @@ -65,6 +69,7 @@ public final class ZipShort implements Cloneable { /** * Get value as Java int. + * @return value as a Java int * @since 1.1 */ public int getValue() { @@ -73,6 +78,8 @@ public final class ZipShort implements Cloneable { /** * Get value as two bytes in big endian byte order. + * @param value the Java int to convert to bytes + * @return the converted int as a byte array in big endian byte order */ public static byte[] getBytes(int value){ byte[] result = new byte[2]; @@ -104,7 +111,7 @@ public final class ZipShort implements Cloneable { /** * Override to make two instances with same value equal. - * + * @param o an object to compare * @since 1.1 */ public boolean equals(Object o) { @@ -116,7 +123,7 @@ public final class ZipShort implements Cloneable { /** * Override to make two instances with same value equal. - * + * @return the value stored in the ZipShort * @since 1.1 */ public int hashCode() {