Tabnine Logo
HashSet.hashCode
Code IndexAdd Tabnine to your IDE (free)

How to use
hashCode
method
in
java.util.HashSet

Best Java code snippets using java.util.HashSet.hashCode (Showing top 20 results out of 639)

origin: org.mockito/mockito-core

@Override public int hashCode() {
  return backingHashSet.hashCode();
}
origin: google/j2objc

@Override public int hashCode() {
  return backingHashSet.hashCode();
}
origin: opentripplanner/OpenTripPlanner

@Override
public int hashCode() {
  return agencyAndStopIds.hashCode();
}
origin: opentripplanner/OpenTripPlanner

@Override
public int hashCode() {
  return agencyAndRouteIds.hashCode() + agencyIdAndRouteNames.hashCode()
      + routeNames.hashCode();
}
origin: Sable/soot

/**
 * {@inheritDoc}
 */
public int hashCode() {
 final int PRIME = 31;
 int result = 1;
 result = PRIME * result + ((subsets == null) ? 0 : subsets.hashCode());
 return result;
}
origin: spotbugs/spotbugs

public void storeOfNull() {
  for (int i = 0; i < 10; i++) {
    HashSet<Integer> set = new HashSet<Integer>();
    set.add(i);
    System.out.println(set.hashCode());
    set = null;
  }
}
origin: google/guava

private static void checkHashCode(Set<?> set) {
 assertEquals(Sets.newHashSet(set).hashCode(), set.hashCode());
}
origin: real-logic/agrona

@Test
public void shouldHaveCompatibleEqualsAndHashcode()
{
  final HashSet<Integer> compatibleSet = new HashSet<>();
  final long seed = System.nanoTime();
  final Random r = new Random(seed);
  for (int i = 0; i < 1024; i++)
  {
    final int value = r.nextInt();
    compatibleSet.add(value);
    testSet.add(value);
  }
  assertEquals("Fail with seed:" + seed, testSet, compatibleSet);
  assertEquals("Fail with seed:" + seed, compatibleSet, testSet);
  assertEquals("Fail with seed:" + seed, compatibleSet.hashCode(), testSet.hashCode());
}
origin: real-logic/agrona

@Test
public void shouldHaveCompatibleEqualsAndHashcode()
{
  final HashSet<Integer> compatibleSet = new HashSet<>();
  final long seed = System.nanoTime();
  final Random r = new Random(seed);
  for (int i = 0; i < 1024; i++)
  {
    final int value = r.nextInt();
    compatibleSet.add(value);
    testSet.add(value);
  }
  if (r.nextBoolean())
  {
    compatibleSet.add(MISSING_VALUE);
    testSet.add(MISSING_VALUE);
  }
  assertEquals("Fail with seed:" + seed, testSet, compatibleSet);
  assertEquals("Fail with seed:" + seed, compatibleSet, testSet);
  assertEquals("Fail with seed:" + seed, compatibleSet.hashCode(), testSet.hashCode());
}
origin: protostuff/protostuff

result = prime * result + ((deque == null) ? 0 : deque.hashCode());
result = prime * result
    + ((hashSet == null) ? 0 : hashSet.hashCode());
result = prime
origin: pentaho/mondrian

h = h * 31 + new HashSet<RolapCalculation>(
  Arrays.asList(calculations)
    .subList(0, calculationCount)).hashCode();
h = h * 31 + slicerMembers.hashCode();
h = h * 31 + (expandingMember == null ? 0 : expandingMember.hashCode());
origin: coherence-community/oracle-bedrock

@Override
public int hashCode()
{
  int result = (autoDeployEnabled ? 1 : 0);
  result = 31 * result + includePaths.hashCode();
  result = 31 * result + excludeFileNames.hashCode();
  return result;
}
origin: hneemann/Digital

  @Override
  public int hashCode() {
    return inputs != null ? inputs.hashCode() : 0;
  }
}
origin: sweble/sweble-wikitext

@Override
public int hashCode()
{
  final int prime = 31;
  int result = 1;
  result = prime * result + ((name == null) ? 0 : name.hashCode());
  result = prime * result + ((pfns == null) ? 0 : pfns.hashCode());
  return result;
}
origin: knowitall/reverb

@Override
public int hashCode() {
  final int prime = 31;
  int result = 1;
  result = prime * result
      + ((layerNames == null) ? 0 : layerNames.hashCode());
  result = prime * result + ((layers == null) ? 0 : layers.hashCode());
  result = prime * result + length;
  result = prime * result + numLayers;
  return result;
}
origin: net.java.dev.glazedlists/glazedlists_java16

  /** @inheritDoc */
  @Override
  public int hashCode() {
    int result;
    result = mode;
    result = 31 * result + strategy.hashCode();
    result = 31 * result + new HashSet<SearchTerm>(Arrays.asList(searchTerms)).hashCode();
    return result;
  }
}
origin: com.haulmont.thirdparty/glazedlists

  /** @inheritDoc */
  @Override
  public int hashCode() {
    int result;
    result = mode;
    result = 31 * result + strategy.hashCode();
    result = 31 * result + new HashSet<SearchTerm>(Arrays.asList(searchTerms)).hashCode();
    return result;
  }
}
origin: jboss/jboss-javaee-specs

@Override
public int hashCode()
{
 int result = 17;
 result = 37 * result + this.urlPattern.hashCode();
 if (this.urlPatternList != null)
   result = 37 * result + this.urlPatternList.hashCode();
 return result;
}
origin: org.jboss.spec.javax.security.jacc/jboss-jacc-api_1.4_spec

@Override
public int hashCode()
{
 int result = 17;
 result = 37 * result + this.urlPattern.hashCode();
 if (this.urlPatternList != null)
   result = 37 * result + this.urlPatternList.hashCode();
 return result;
}
origin: org.batoo.jpa/batoo-jpa

/**
 * {@inheritDoc}
 * 
 */
@Override
public int hashCode() {
  this.initialize();
  return this.delegate.hashCode();
}
java.utilHashSethashCode

Popular methods of HashSet

  • <init>
  • add
    Adds the specified element to this set if it is not already present. More formally, adds the specifi
  • contains
    Returns true if this set contains the specified element. More formally, returns true if and only if
  • size
    Returns the number of elements in this set (its cardinality).
  • addAll
  • remove
    Removes the specified element from this set if it is present. More formally, removes an element e su
  • iterator
    Returns an iterator over the elements in this set. The elements are returned in no particular order.
  • isEmpty
    Returns true if this set contains no elements.
  • clear
    Removes all of the elements from this set. The set will be empty after this call returns.
  • toArray
  • removeAll
  • equals
  • removeAll,
  • equals,
  • clone,
  • retainAll,
  • stream,
  • containsAll,
  • forEach,
  • toString,
  • removeIf

Popular in Java

  • Finding current android device location
  • scheduleAtFixedRate (ScheduledExecutorService)
  • onRequestPermissionsResult (Fragment)
  • scheduleAtFixedRate (Timer)
  • MalformedURLException (java.net)
    This exception is thrown when a program attempts to create an URL from an incorrect specification.
  • URL (java.net)
    A Uniform Resource Locator that identifies the location of an Internet resource as specified by RFC
  • Date (java.sql)
    A class which can consume and produce dates in SQL Date format. Dates are represented in SQL as yyyy
  • Handler (java.util.logging)
    A Handler object accepts a logging request and exports the desired messages to a target, for example
  • JCheckBox (javax.swing)
  • Logger (org.apache.log4j)
    This is the central class in the log4j package. Most logging operations, except configuration, are d
  • Top 12 Jupyter Notebook extensions
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