Arrays.HashCode Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
HashCode(Single[]) |
Returns a hash code based on the contents of the specified array. |
HashCode(Int64[]) |
Returns a hash code based on the contents of the specified array. |
HashCode(Int32[]) |
Returns a hash code based on the contents of the specified array. |
HashCode(Int16[]) |
Returns a hash code based on the contents of the specified array. |
HashCode(Double[]) |
Returns a hash code based on the contents of the specified array. |
HashCode(Char[]) |
Returns a hash code based on the contents of the specified array. |
HashCode(Byte[]) |
Returns a hash code based on the contents of the specified array. |
HashCode(Boolean[]) |
Returns a hash code based on the contents of the specified array. |
HashCode(Object[]) |
Returns a hash code based on the contents of the specified array. |
HashCode(Single[])
Returns a hash code based on the contents of the specified array.
[Android.Runtime.Register("hashCode", "([F)I", "")]
public static int HashCode (float[]? a);
[<Android.Runtime.Register("hashCode", "([F)I", "")>]
static member HashCode : single[] -> int
Parameters
- a
- Single[]
the array whose hash value to compute
Returns
a content-based hash code for a
- Attributes
Remarks
Returns a hash code based on the contents of the specified array. For any two float
arrays a
and b
such that Arrays.equals(a, b)
, it is also the case that Arrays.hashCode(a) == Arrays.hashCode(b)
.
The value returned by this method is the same value that would be obtained by invoking the List#hashCode() hashCode
method on a List
containing a sequence of Float
instances representing the elements of a
in the same order. If a
is null
, this method returns 0.
Added in 1.5.
Java documentation for java.util.Arrays.hashCode(float[])
.
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.
Applies to
HashCode(Int64[])
Returns a hash code based on the contents of the specified array.
[Android.Runtime.Register("hashCode", "([J)I", "")]
public static int HashCode (long[]? a);
[<Android.Runtime.Register("hashCode", "([J)I", "")>]
static member HashCode : int64[] -> int
Parameters
- a
- Int64[]
the array whose hash value to compute
Returns
a content-based hash code for a
- Attributes
Remarks
Returns a hash code based on the contents of the specified array. For any two long
arrays a
and b
such that Arrays.equals(a, b)
, it is also the case that Arrays.hashCode(a) == Arrays.hashCode(b)
.
The value returned by this method is the same value that would be obtained by invoking the List#hashCode() hashCode
method on a List
containing a sequence of Long
instances representing the elements of a
in the same order. If a
is null
, this method returns 0.
Added in 1.5.
Java documentation for java.util.Arrays.hashCode(long[])
.
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.
Applies to
HashCode(Int32[])
Returns a hash code based on the contents of the specified array.
[Android.Runtime.Register("hashCode", "([I)I", "")]
public static int HashCode (int[]? a);
[<Android.Runtime.Register("hashCode", "([I)I", "")>]
static member HashCode : int[] -> int
Parameters
- a
- Int32[]
the array whose hash value to compute
Returns
a content-based hash code for a
- Attributes
Remarks
Returns a hash code based on the contents of the specified array. For any two non-null int
arrays a
and b
such that Arrays.equals(a, b)
, it is also the case that Arrays.hashCode(a) == Arrays.hashCode(b)
.
The value returned by this method is the same value that would be obtained by invoking the List#hashCode() hashCode
method on a List
containing a sequence of Integer
instances representing the elements of a
in the same order. If a
is null
, this method returns 0.
Added in 1.5.
Java documentation for java.util.Arrays.hashCode(int[])
.
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.
Applies to
HashCode(Int16[])
Returns a hash code based on the contents of the specified array.
[Android.Runtime.Register("hashCode", "([S)I", "")]
public static int HashCode (short[]? a);
[<Android.Runtime.Register("hashCode", "([S)I", "")>]
static member HashCode : int16[] -> int
Parameters
- a
- Int16[]
the array whose hash value to compute
Returns
a content-based hash code for a
- Attributes
Remarks
Returns a hash code based on the contents of the specified array. For any two short
arrays a
and b
such that Arrays.equals(a, b)
, it is also the case that Arrays.hashCode(a) == Arrays.hashCode(b)
.
The value returned by this method is the same value that would be obtained by invoking the List#hashCode() hashCode
method on a List
containing a sequence of Short
instances representing the elements of a
in the same order. If a
is null
, this method returns 0.
Added in 1.5.
Java documentation for java.util.Arrays.hashCode(short[])
.
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.
Applies to
HashCode(Double[])
Returns a hash code based on the contents of the specified array.
[Android.Runtime.Register("hashCode", "([D)I", "")]
public static int HashCode (double[]? a);
[<Android.Runtime.Register("hashCode", "([D)I", "")>]
static member HashCode : double[] -> int
Parameters
- a
- Double[]
the array whose hash value to compute
Returns
a content-based hash code for a
- Attributes
Remarks
Returns a hash code based on the contents of the specified array. For any two double
arrays a
and b
such that Arrays.equals(a, b)
, it is also the case that Arrays.hashCode(a) == Arrays.hashCode(b)
.
The value returned by this method is the same value that would be obtained by invoking the List#hashCode() hashCode
method on a List
containing a sequence of Double
instances representing the elements of a
in the same order. If a
is null
, this method returns 0.
Added in 1.5.
Java documentation for java.util.Arrays.hashCode(double[])
.
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.
Applies to
HashCode(Char[])
Returns a hash code based on the contents of the specified array.
[Android.Runtime.Register("hashCode", "([C)I", "")]
public static int HashCode (char[]? a);
[<Android.Runtime.Register("hashCode", "([C)I", "")>]
static member HashCode : char[] -> int
Parameters
- a
- Char[]
the array whose hash value to compute
Returns
a content-based hash code for a
- Attributes
Remarks
Returns a hash code based on the contents of the specified array. For any two char
arrays a
and b
such that Arrays.equals(a, b)
, it is also the case that Arrays.hashCode(a) == Arrays.hashCode(b)
.
The value returned by this method is the same value that would be obtained by invoking the List#hashCode() hashCode
method on a List
containing a sequence of Character
instances representing the elements of a
in the same order. If a
is null
, this method returns 0.
Added in 1.5.
Java documentation for java.util.Arrays.hashCode(char[])
.
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.
Applies to
HashCode(Byte[])
Returns a hash code based on the contents of the specified array.
[Android.Runtime.Register("hashCode", "([B)I", "")]
public static int HashCode (byte[]? a);
[<Android.Runtime.Register("hashCode", "([B)I", "")>]
static member HashCode : byte[] -> int
Parameters
- a
- Byte[]
the array whose hash value to compute
Returns
a content-based hash code for a
- Attributes
Remarks
Returns a hash code based on the contents of the specified array. For any two byte
arrays a
and b
such that Arrays.equals(a, b)
, it is also the case that Arrays.hashCode(a) == Arrays.hashCode(b)
.
The value returned by this method is the same value that would be obtained by invoking the List#hashCode() hashCode
method on a List
containing a sequence of Byte
instances representing the elements of a
in the same order. If a
is null
, this method returns 0.
Added in 1.5.
Java documentation for java.util.Arrays.hashCode(byte[])
.
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.
Applies to
HashCode(Boolean[])
Returns a hash code based on the contents of the specified array.
[Android.Runtime.Register("hashCode", "([Z)I", "")]
public static int HashCode (bool[]? a);
[<Android.Runtime.Register("hashCode", "([Z)I", "")>]
static member HashCode : bool[] -> int
Parameters
- a
- Boolean[]
the array whose hash value to compute
Returns
a content-based hash code for a
- Attributes
Remarks
Returns a hash code based on the contents of the specified array. For any two boolean
arrays a
and b
such that Arrays.equals(a, b)
, it is also the case that Arrays.hashCode(a) == Arrays.hashCode(b)
.
The value returned by this method is the same value that would be obtained by invoking the List#hashCode() hashCode
method on a List
containing a sequence of Boolean
instances representing the elements of a
in the same order. If a
is null
, this method returns 0.
Added in 1.5.
Java documentation for java.util.Arrays.hashCode(boolean[])
.
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.
Applies to
HashCode(Object[])
Returns a hash code based on the contents of the specified array.
[Android.Runtime.Register("hashCode", "([Ljava/lang/Object;)I", "")]
public static int HashCode (Java.Lang.Object[]? a);
[<Android.Runtime.Register("hashCode", "([Ljava/lang/Object;)I", "")>]
static member HashCode : Java.Lang.Object[] -> int
Parameters
- a
- Object[]
the array whose content-based hash code to compute
Returns
a content-based hash code for a
- Attributes
Remarks
Returns a hash code based on the contents of the specified array. If the array contains other arrays as elements, the hash code is based on their identities rather than their contents. It is therefore acceptable to invoke this method on an array that contains itself as an element, either directly or indirectly through one or more levels of arrays.
For any two arrays a
and b
such that Arrays.equals(a, b)
, it is also the case that Arrays.hashCode(a) == Arrays.hashCode(b)
.
The value returned by this method is equal to the value that would be returned by Arrays.asList(a).hashCode()
, unless a
is null
, in which case 0
is returned.
Added in 1.5.
Java documentation for java.util.Arrays.hashCode(java.lang.Object[])
.
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.