Here you can find the source of hashCode(Object object)
hashCode()
of object
.
Parameter | Description |
---|---|
object | the object for which to return the hashcode |
0
if object
is null
public static int hashCode(Object object)
//package com.java2s; /*// ww w . jav a 2 s . com Copyright 1996-2013 Ariba, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. $Id: //ariba/platform/util/core/ariba/util/core/SystemUtil.java#39 $ */ public class Main { /** Convenience method that returns the <code>hashCode()</code> of <code>object</code>. The case of a <code>null</code> <code>object</code> is handled; zero is returned. <p/> This method is complementary to the method {@link #equal} which tests two objects for equality in a <code>null</code> safe manner. <p/> @param object the object for which to return the hashcode @return the hashcode value or <code>0</code> if <code>object</code> is <code>null</code> @aribaapi ariba */ public static int hashCode(Object object) { return object != null ? object.hashCode() : 0; } }