/[classpath]/classpath/gnu/CORBA/gnuAny.java
ViewVC logotype

Diff of /classpath/gnu/CORBA/gnuAny.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1.2.4 by gnu_andrew, Tue Aug 16 16:22:35 2005 UTC revision 1.1.2.5 by gnu_andrew, Tue Sep 20 18:46:22 2005 UTC
# Line 62  import org.omg.CORBA.StringHolder; Line 62  import org.omg.CORBA.StringHolder;
62  import org.omg.CORBA.TCKind;  import org.omg.CORBA.TCKind;
63  import org.omg.CORBA.TypeCode;  import org.omg.CORBA.TypeCode;
64  import org.omg.CORBA.TypeCodeHolder;  import org.omg.CORBA.TypeCodeHolder;
 import org.omg.CORBA.TypeCodePackage.BadKind;  
65  import org.omg.CORBA.ValueBaseHolder;  import org.omg.CORBA.ValueBaseHolder;
66  import org.omg.CORBA.portable.BoxedValueHelper;  import org.omg.CORBA.portable.BoxedValueHelper;
67  import org.omg.CORBA.portable.Streamable;  import org.omg.CORBA.portable.Streamable;
68    
 import java.io.IOException;  
69  import java.io.Serializable;  import java.io.Serializable;
   
70  import java.lang.reflect.Field;  import java.lang.reflect.Field;
   
71  import java.math.BigDecimal;  import java.math.BigDecimal;
   
72  import java.util.Arrays;  import java.util.Arrays;
73    import java.util.zip.Adler32;
74    
75  /**  /**
76   * The implementation of {@link Any}.   * The implementation of {@link Any}.
# Line 207  public class gnuAny Line 203  public class gnuAny
203    
204      return Arrays.equals(ba, bb);      return Arrays.equals(ba, bb);
205    }    }
206      
207      /**
208       * Get the content - dependent hashcode.
209       */
210      public int hashCode()
211      {
212        if (has == null)
213          return type().kind().value();
214        else
215          {
216            Adler32 adler = new Adler32();
217    
218            cdrBufOutput a = new cdrBufOutput();
219            a.setOrb(orb);
220            write_value(a);
221            
222            adler.update(a.buffer.toByteArray());
223            adler.update(type().kind().value());
224            
225            return (int) adler.getValue() & Integer.MAX_VALUE;
226          }
227      }
228    
229    /**    /**
230     * Delegates functionality to {@link #equal(Any)}.     * Delegates functionality to {@link #equal(Any)}.

Legend:
Removed from v.1.1.2.4  
changed lines
  Added in v.1.1.2.5

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26