ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From peterrei...@apache.org
Subject cvs commit: ant/src/main/org/apache/tools/zip ZipShort.java ZipLong.java
Date Mon, 06 Dec 2004 09:28:40 GMT
peterreilly    2004/12/06 01:28:40

  Modified:    src/main/org/apache/tools/zip ZipShort.java ZipLong.java
  Log:
  Minor corrections plus added @param and @return where missing
  Obtained from: Kevin Jackson
  
  Revision  Changes    Path
  1.12      +11 -4     ant/src/main/org/apache/tools/zip/ZipShort.java
  
  Index: ZipShort.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/zip/ZipShort.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- ZipShort.java	4 Dec 2004 00:03:50 -0000	1.11
  +++ ZipShort.java	6 Dec 2004 09:28:40 -0000	1.12
  @@ -29,7 +29,7 @@
   
       /**
        * 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 @@
   
       /**
        * Create instance from bytes.
  +     * @param bytes the bytes to store as a ZipShort
        * @since 1.1
        */
       public ZipShort (byte[] bytes) {
  @@ -46,6 +47,8 @@
   
       /**
        * 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 @@
   
       /**
        * 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 @@
   
       /**
        * Get value as Java int.
  +     * @return value as a Java int
        * @since 1.1
        */
       public int getValue() {
  @@ -73,6 +78,8 @@
   
       /**
        * 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 @@
   
       /**
        * 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 @@
   
       /**
        * Override to make two instances with same value equal.
  -     *
  +     * @return the value stored in the ZipShort
        * @since 1.1
        */
       public int hashCode() {
  
  
  
  1.12      +14 -8     ant/src/main/org/apache/tools/zip/ZipLong.java
  
  Index: ZipLong.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/zip/ZipLong.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- ZipLong.java	4 Dec 2004 00:03:50 -0000	1.11
  +++ ZipLong.java	6 Dec 2004 09:28:40 -0000	1.12
  @@ -29,6 +29,7 @@
   
       /**
        * 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 @@
   
       /**
        * Create instance from bytes.
  +     * @param bytes the bytes to store as a ZipLong
        * @since 1.1
        */
       public ZipLong (byte[] bytes) {
  @@ -45,6 +47,8 @@
   
       /**
        * 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 @@
       /**
        * 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 @@
       }
   
       /**
  -     * 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 @@
       }
   
       /**
  -     * 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 @@
   
       /**
        * 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 @@
   
       /**
        * Override to make two instances with same value equal.
  -     *
  +     * @return the value stored in the ZipLong
        * @since 1.1
        */
       public int hashCode() {
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message