Tabnine Logo
Arrays.deepHashCode
Code IndexAdd Tabnine to your IDE (free)

How to use
deepHashCode
method
in
java.util.Arrays

Best Java code snippets using java.util.Arrays.deepHashCode (Showing top 20 results out of 2,439)

origin: apache/flink

@Override
public int hashCode() {
  return Arrays.deepHashCode(fields);
}
origin: spring-projects/spring-framework

/**
 * Create a new {@link SimpleKey} instance.
 * @param elements the elements of the key
 */
public SimpleKey(Object... elements) {
  Assert.notNull(elements, "Elements must not be null");
  this.params = new Object[elements.length];
  System.arraycopy(elements, 0, this.params, 0, elements.length);
  this.hashCode = Arrays.deepHashCode(this.params);
}
origin: wildfly/wildfly

/**
 * Get the hash code of this principal.
 *
 * @return the hash code of this principal
 */
public int hashCode() {
  return Arrays.deepHashCode(p);
}
origin: pentaho/pentaho-kettle

private int calculateHashCode( Object[] keyFields ) {
 // deep used because Binary type is a native byte[]
 return Arrays.deepHashCode( keyFields );
}
origin: apache/geode

@Override
public int hashCode(Object o) {
 Object[] oa = (Object[]) o;
 return Arrays.deepHashCode(oa);
}
origin: org.apache.commons/commons-math3

/**
 * {@inheritDoc}
 */
@Override
public int hashCode() {
  return Arrays.deepHashCode(markerArray);
}
origin: apache/storm

private static <T> int listHashCode(List<T> alist) {
  if (alist == null) {
    return 1;
  } else {
    return Arrays.deepHashCode(alist.toArray());
  }
}
origin: pentaho/pentaho-kettle

/**
 * Calculates a simple hashCode of all the native data objects in the supplied row. This method will return a better
 * distribution of values for rows of numbers or rows with the same values in different positions. NOTE: This method
 * performs against the native values, not the values returned by ValueMeta. This means that if you have two rows with
 * different primitive values ['2008-01-01:12:30'] and ['2008-01-01:00:00'] that use a format object to change the
 * value (as Date yyyy-MM-dd), the hashCodes will be different resulting in the two rows not being considered equal
 * via the hashCode even though compare() or equals() might consider them to be.
 *
 * @param rowData The data to calculate a hashCode with
 * @return the calculated hashCode
 * @throws KettleValueException in case there is a data conversion error
 */
@Override
public int hashCode( Object[] rowData ) throws KettleValueException {
 return Arrays.deepHashCode( rowData );
}
origin: spotbugs/spotbugs

@Override
public int hashCode() {
  return Arrays.deepHashCode(data);
}
origin: org.springframework/spring-context

/**
 * Create a new {@link SimpleKey} instance.
 * @param elements the elements of the key
 */
public SimpleKey(Object... elements) {
  Assert.notNull(elements, "Elements must not be null");
  this.params = new Object[elements.length];
  System.arraycopy(elements, 0, this.params, 0, elements.length);
  this.hashCode = Arrays.deepHashCode(this.params);
}
origin: speedment/speedment

@Override
public int hashCode() {
  int hash = 5;
  hash = 29 * hash + Objects.hashCode(this.fullName);
  hash = 29 * hash + Arrays.deepHashCode(this.parameters);
  return hash;
}

origin: apache/nifi

@Override
public int hashCode() {
  if (value == null) {
    return 31;
  }
  if (value instanceof Object[]) {
    return 31 + Arrays.deepHashCode((Object[]) value);
  }
  return 31 + value.hashCode();
}
origin: com.google.inject/guice

/** Implements {@link Annotation#hashCode}. */
private static int annotationHashCode(
  Class<? extends Annotation> type, Map<String, Object> members) throws Exception {
 int result = 0;
 for (Method method : type.getDeclaredMethods()) {
  String name = method.getName();
  Object value = members.get(name);
  result += (127 * name.hashCode()) ^ (Arrays.deepHashCode(new Object[] {value}) - 31);
 }
 return result;
}
origin: org.assertj/assertj-core

/**
 * Returns the hash code for the given object. If the object is {@code null}, this method returns zero. Otherwise
 * calls the method {@code hashCode} of the given object.
 *
 * @param o the given object.
 * @return the hash code for the given object
 */
public static int hashCodeFor(Object o) {
 if (o == null) return 0;
 return isArray(o) && !o.getClass().getComponentType().isPrimitive() ? java.util.Arrays.deepHashCode((Object[]) o) : o.hashCode() ;
}
origin: addthis/stream-lib

@Override
public int hashCode() {
  int result;
  long temp;
  result = depth;
  result = 31 * result + width;
  result = 31 * result + Arrays.deepHashCode(table);
  result = 31 * result + Arrays.hashCode(hashA);
  result = 31 * result + (int) (size ^ (size >>> 32));
  temp = Double.doubleToLongBits(eps);
  result = 31 * result + (int) (temp ^ (temp >>> 32));
  temp = Double.doubleToLongBits(confidence);
  result = 31 * result + (int) (temp ^ (temp >>> 32));
  return result;
}
origin: joel-costigliola/assertj-core

/**
 * Returns the hash code for the given object. If the object is {@code null}, this method returns zero. Otherwise
 * calls the method {@code hashCode} of the given object.
 *
 * @param o the given object.
 * @return the hash code for the given object
 */
public static int hashCodeFor(Object o) {
 if (o == null) return 0;
 return isArray(o) && !o.getClass().getComponentType().isPrimitive() ? java.util.Arrays.deepHashCode((Object[]) o) : o.hashCode() ;
}
origin: spring-cloud/spring-cloud-config

public int hashCode() {
  final int PRIME = 59;
  int result = 1;
  result = result * PRIME + java.util.Arrays.deepHashCode(this.getPaths());
  return result;
}
origin: apache/storm

for (Object o : selectedFields) {
  if (o instanceof List) {
    out.putInt(Arrays.deepHashCode(((List) o).toArray()));
  } else if (o instanceof Object[]) {
    out.putInt(Arrays.deepHashCode((Object[]) o));
  } else if (o instanceof byte[]) {
    out.putInt(Arrays.hashCode((byte[]) o));
origin: deeplearning4j/nd4j

@Override
public int hashCode() {
  int result = super.hashCode();
  result = 31 * result + Arrays.deepHashCode(axes);
  result = 31 * result + (addedEdges ? 1 : 0);
  result = 31 * result + (mMulTranspose != null ? mMulTranspose.hashCode() : 0);
  return result;
}
origin: jMonkeyEngine/jmonkeyengine

@Override
public int hashCode() {
  int hash = 5;
  hash = 73 * hash + (this.pos != null ? this.pos.hashCode() : 0);
  hash = 73 * hash + (this.norm != null ? this.norm.hashCode() : 0);
  hash = 73 * hash + (this.tang4d != null ? this.tang4d.hashCode() : 0);
  hash = 73 * hash + (this.tang != null ? this.tang.hashCode() : 0);
  hash = 73 * hash + (this.uv0 != null ? this.uv0.hashCode() : 0);
  hash = 73 * hash + (this.uv1 != null ? this.uv1.hashCode() : 0);
  hash = 73 * hash + (this.color != null ? this.color.hashCode() : 0);
  hash = 73 * hash + (this.material != null ? this.material.hashCode() : 0);
  hash = 73 * hash + (this.smoothing != null ? this.smoothing.hashCode() : 0);
  hash = 73 * hash + Arrays.deepHashCode(this.boneWeightsIndices);
  return hash;
}
java.utilArraysdeepHashCode

Javadoc

Returns a hash code based on the "deep contents" of the given array. If the array contains other arrays as its elements, the hash code is based on their contents not their identities. So it is not acceptable to invoke this method on an array that contains itself as an element, either directly or indirectly.

For any two arrays a and b, if Arrays.deepEquals(a, b) returns true, it means that the return value of Arrays.deepHashCode(a) equals Arrays.deepHashCode(b).

The computation of the value returned by this method is similar to that of the value returned by List#hashCode() invoked on a List containing a sequence of instances representing the elements of array in the same order. The difference is: If an element e of array is itself an array, its hash code is computed by calling the appropriate overloading of Arrays.hashCode(e) if e is an array of a primitive type, or by calling Arrays.deepHashCode(e) recursively if e is an array of a reference type. The value returned by this method is the same value as the method Arrays.asList(array).hashCode(). If the array is null, the return value is 0.

Popular methods of Arrays

  • asList
  • toString
    Returns a string representation of the contents of the specified array. The string representation co
  • equals
    Returns true if the two specified arrays of booleans areequal to one another. Two arrays are conside
  • sort
    Sorts the specified range of the array into ascending order. The range to be sorted extends from the
  • copyOf
    Copies the specified array, truncating or padding with false (if necessary) so the copy has the spec
  • fill
    Assigns the specified boolean value to each element of the specified array of booleans.
  • stream
  • hashCode
    Returns a hash code based on the contents of the specified array. For any two boolean arrays a and
  • copyOfRange
    Copies the specified range of the specified array into a new array. The initial index of the range (
  • binarySearch
    Searches the specified array of shorts for the specified value using the binary search algorithm. Th
  • deepEquals
    Returns true if the two specified arrays are deeply equal to one another. Unlike the #equals(Object[
  • deepToString
  • deepEquals,
  • deepToString,
  • setAll,
  • parallelSort,
  • parallelSetAll,
  • spliterator,
  • checkBinarySearchBounds,
  • checkOffsetAndCount,
  • checkStartAndEnd

Popular in Java

  • Running tasks concurrently on multiple threads
  • getSystemService (Context)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • URL (java.net)
    A Uniform Resource Locator that identifies the location of an Internet resource as specified by RFC
  • SortedSet (java.util)
    SortedSet is a Set which iterates over its elements in a sorted order. The order is determined eithe
  • TimeUnit (java.util.concurrent)
    A TimeUnit represents time durations at a given unit of granularity and provides utility methods to
  • ReentrantLock (java.util.concurrent.locks)
    A reentrant mutual exclusion Lock with the same basic behavior and semantics as the implicit monitor
  • Servlet (javax.servlet)
    Defines methods that all servlets must implement. A servlet is a small Java program that runs within
  • JLabel (javax.swing)
  • Top Sublime Text plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now