com.ijchart.xychart.util
Class HashcodeUtil

java.lang.Object
  extended by com.ijchart.xychart.util.HashcodeUtil

public final class HashcodeUtil
extends java.lang.Object

Title: IJChart

Description: a chart library for the Java(tm) platform.

计算hashcode的工具类.

Copyright: Copyright (c) 2013

Company:

Version:
1.0
Author:
zhang feng min,shanghai china. Contract me by email.

Method Summary
static int hashCode(boolean b)
          计算一个对象的hashcode值,b为真返回1否则返回0.
static int hashCode(java.awt.Image image)
          计算一个Image的hashcode值.如果图片是null,返回0,否则返回image.width*image.height.
static int hashCode(java.lang.Object object)
          计算一个对象的hashcode值,如果对象为null,返回0.
static int hashCode(java.lang.Object[] object)
          计算一个数组的hashcode值,如果对象为null,返回0.
static int hashCode(java.awt.Paint paint)
          计算Paint对象的hashcode值.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

hashCode

public static int hashCode(java.lang.Object object)
计算一个对象的hashcode值,如果对象为null,返回0.

Parameters:
object - Object 要计算hashcode的对象 (可为null).
Returns:
对象的hashcode值,如果对象为null,返回0.

hashCode

public static int hashCode(java.lang.Object[] object)
计算一个数组的hashcode值,如果对象为null,返回0.

Parameters:
object - Object 要计算hashcode的对象 (可为null).
Returns:
对象的hashcode值,如果对象为null,返回0.

hashCode

public static int hashCode(java.awt.Image image)
计算一个Image的hashcode值.如果图片是null,返回0,否则返回image.width*image.height.

Parameters:
image - Image 要计算hashcode的Image (可为null).
Returns:
如果图片是null,返回0,否则返回image.width*image.height.

hashCode

public static int hashCode(boolean b)
计算一个对象的hashcode值,b为真返回1否则返回0.

Parameters:
b - boolean 要计算hashcode的布尔值 (可为null).
Returns:
如果b为真返回1,否则返回0.

hashCode

public static int hashCode(java.awt.Paint paint)
计算Paint对象的hashcode值.

Parameters:
paint - Paint Paint对象 (可为null).
Returns:
int hashcode值.