Package org.jfree.chart
Class HashUtils
java.lang.Object
org.jfree.chart.HashUtils
Some utility methods for calculating hash codes.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic int
hashCode
(int pre, boolean b) Returns a hash value based on a seed value and the value of a boolean primitive.static int
hashCode
(int pre, double d) Returns a hash value based on a seed value and the value of a double primitive.static int
hashCode
(int pre, int i) Returns a hash value based on a seed value and the value of an int primitive.static int
Returns a hash value based on a seed value and a paint instance.static int
Returns a hash value based on a seed value and a stroke instance.static int
hashCode
(int pre, Comparable c) Returns a hash value based on a seed value and aComparable
instance.static int
Returns a hash value based on a seed value and anObject
instance.static int
Returns a hash value based on a seed value and a string instance.static int
hashCode
(int pre, BooleanList list) Computes a hash code for aBooleanList
.static int
Computes a hash code for aPaintList
.static int
hashCode
(int pre, StrokeList list) Computes a hash code for aStrokeList
.static int
hashCodeForDoubleArray
(double[] a) Returns a hash code for adouble[]
instance.static int
Returns a hash code for aPaint
instance.
-
Constructor Details
-
HashUtils
public HashUtils()
-
-
Method Details
-
hashCodeForPaint
Returns a hash code for aPaint
instance. Ifp
isnull
, this method returns zero.- Parameters:
p
- the paint (null
permitted).- Returns:
- The hash code.
-
hashCodeForDoubleArray
Returns a hash code for adouble[]
instance. If the array isnull
, this method returns zero.- Parameters:
a
- the array (null
permitted).- Returns:
- The hash code.
-
hashCode
Returns a hash value based on a seed value and the value of a boolean primitive.- Parameters:
pre
- the seed value.b
- the boolean value.- Returns:
- A hash value.
-
hashCode
Returns a hash value based on a seed value and the value of an int primitive.- Parameters:
pre
- the seed value.i
- the int value.- Returns:
- A hash value.
-
hashCode
Returns a hash value based on a seed value and the value of a double primitive.- Parameters:
pre
- the seed value.d
- the double value.- Returns:
- A hash value.
-
hashCode
Returns a hash value based on a seed value and a paint instance.- Parameters:
pre
- the seed value.p
- the paint (null
permitted).- Returns:
- A hash value.
-
hashCode
Returns a hash value based on a seed value and a stroke instance.- Parameters:
pre
- the seed value.s
- the stroke (null
permitted).- Returns:
- A hash value.
-
hashCode
Returns a hash value based on a seed value and a string instance.- Parameters:
pre
- the seed value.s
- the string (null
permitted).- Returns:
- A hash value.
-
hashCode
Returns a hash value based on a seed value and aComparable
instance.- Parameters:
pre
- the seed value.c
- the comparable (null
permitted).- Returns:
- A hash value.
-
hashCode
Returns a hash value based on a seed value and anObject
instance.- Parameters:
pre
- the seed value.obj
- the object (null
permitted).- Returns:
- A hash value.
-
hashCode
Computes a hash code for aBooleanList
. In the latest version of JCommon, theBooleanList
class should implement the hashCode() method correctly, but we compute it here anyway so that we can work with older versions of JCommon (back to 1.0.0).- Parameters:
pre
- the seed value.list
- the list (null
permitted).- Returns:
- The hash code.
-
hashCode
Computes a hash code for aPaintList
. In the latest version of JCommon, thePaintList
class should implement the hashCode() method correctly, but we compute it here anyway so that we can work with older versions of JCommon (back to 1.0.0).- Parameters:
pre
- the seed value.list
- the list (null
permitted).- Returns:
- The hash code.
-
hashCode
Computes a hash code for aStrokeList
. In the latest version of JCommon, theStrokeList
class should implement the hashCode() method correctly, but we compute it here anyway so that we can work with older versions of JCommon (back to 1.0.0).- Parameters:
pre
- the seed value.list
- the list (null
permitted).- Returns:
- The hash code.
-