From f71037f4486c36bde9683835dedc98652ef9a5e0 Mon Sep 17 00:00:00 2001 From: Rainer Klute Date: Fri, 7 Nov 2003 19:24:29 +0000 Subject: [PATCH] *** empty log message *** git-svn-id: https://svn.apache.org/repos/asf/jakarta/poi/trunk@353439 13f79535-47bb-0310-9956-ffa450edef68 --- src/java/org/apache/poi/hpsf/ClassID.java | 40 +++++++++++++---------- 1 file changed, 22 insertions(+), 18 deletions(-) diff --git a/src/java/org/apache/poi/hpsf/ClassID.java b/src/java/org/apache/poi/hpsf/ClassID.java index 549cad05b6..fcc8b41edd 100644 --- a/src/java/org/apache/poi/hpsf/ClassID.java +++ b/src/java/org/apache/poi/hpsf/ClassID.java @@ -233,32 +233,36 @@ public class ClassID return true; } + + /** - * Returns a human readable representation of the Class ID - * in standard format "{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}" - * @return String representation of the Class ID represented - * by this object. + * @see Object#hashCode() */ - public String toString() + public int hashCode() { - StringBuffer sbClassId = new StringBuffer( 38); - sbClassId.append( '{'); - for( int i=0; i < 16; i++) { - sbClassId.append( HexDump.toHex( bytes[ i])); - if( i == 3 || i == 5 || i == 7 || i == 9) { - sbClassId.append( '-'); - } - } - sbClassId.append( '}'); - return sbClassId.toString(); + return new String(bytes).hashCode(); } + + /** - * @see Object#hashCode() + *

Returns a human-readable representation of the Class ID in standard + * format "{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}".

+ * + * @return String representation of the Class ID represented by this object. */ - public int hashCode() + public String toString() { - return new String(bytes).hashCode(); + StringBuffer sbClassId = new StringBuffer(38); + sbClassId.append('{'); + for (int i = 0; i < 16; i++) + { + sbClassId.append(HexDump.toHex(bytes[i])); + if (i == 3 || i == 5 || i == 7 || i == 9) + sbClassId.append('-'); + } + sbClassId.append('}'); + return sbClassId.toString(); } } -- 2.39.5