diff options
author | Mark Wielaard <mark@klomp.org> | 2005-11-15 23:20:01 +0000 |
---|---|---|
committer | Mark Wielaard <mark@klomp.org> | 2005-11-15 23:20:01 +0000 |
commit | 8079928c7ce26b013601b8ebf20c69c63181278f (patch) | |
tree | a5eb7cf42a51869cc8aa1fad7ad6a90cca47fdd8 /libjava/classpath/org/omg/CosNaming/NameComponent.java | |
parent | 7efc292acde3fb6dcc93984451ad21a109518417 (diff) |
Imported GNU Classpath 0.19 + gcj-import-20051115.
* sources.am: Regenerated.
* Makefile.in: Likewise.
* scripts/makemake.tcl: Use glob -nocomplain.
git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@107049 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/classpath/org/omg/CosNaming/NameComponent.java')
-rw-r--r-- | libjava/classpath/org/omg/CosNaming/NameComponent.java | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/libjava/classpath/org/omg/CosNaming/NameComponent.java b/libjava/classpath/org/omg/CosNaming/NameComponent.java index a2db313e620..1e06caaeffe 100644 --- a/libjava/classpath/org/omg/CosNaming/NameComponent.java +++ b/libjava/classpath/org/omg/CosNaming/NameComponent.java @@ -40,6 +40,8 @@ package org.omg.CosNaming; import org.omg.CORBA.portable.IDLEntity; +import java.util.zip.Adler32; + /** * The name component, a node in the multi-comonent name. * @@ -115,4 +117,14 @@ public final class NameComponent { return id + "." + kind; } -}
\ No newline at end of file + + /** + * Return the hashCode of this NameComponent. + */ + public int hashCode() + { + Adler32 adler = new Adler32(); + adler.update(toString().getBytes()); + return (int) adler.getValue() & Integer.MAX_VALUE; + } +} |