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

How to use
equals
method
in
java.util.HashSet

Best Java code snippets using java.util.HashSet.equals (Showing top 20 results out of 1,872)

origin: org.mockito/mockito-core

@Override public boolean equals(Object o) {
  if (!(o instanceof HashCodeAndEqualsSafeSet)) {
    return false;
  }
  HashCodeAndEqualsSafeSet that = (HashCodeAndEqualsSafeSet) o;
  return backingHashSet.equals(that.backingHashSet);
}
origin: google/j2objc

@Override public boolean equals(Object o) {
  if (!(o instanceof HashCodeAndEqualsSafeSet)) {
    return false;
  }
  HashCodeAndEqualsSafeSet that = (HashCodeAndEqualsSafeSet) o;
  return backingHashSet.equals(that.backingHashSet);
}
origin: opentripplanner/OpenTripPlanner

@Override
public boolean equals(Object another) {
  if (another == null || !(another instanceof StopMatcher)) {
    return false;
  }
  if (another == this) {
    return true;
  }
  StopMatcher anotherMatcher = (StopMatcher) another;
  return agencyAndStopIds.equals(anotherMatcher.agencyAndStopIds);
}
origin: opentripplanner/OpenTripPlanner

@Override
public boolean equals(Object another) {
  if (another == null || !(another instanceof RouteMatcher))
    return false;
  if (another == this)
    return true;
  RouteMatcher anotherMatcher = (RouteMatcher) another;
  return agencyAndRouteIds.equals(anotherMatcher.agencyAndRouteIds)
      && agencyIdAndRouteNames.equals(anotherMatcher.agencyIdAndRouteNames)
      && routeNames.equals(anotherMatcher.routeNames);
}
origin: Sable/soot

 public boolean isEquivTo(RWSet other) {
  if (!(other instanceof SiteRWSet)) {
   return false;
  }
  SiteRWSet o = (SiteRWSet) other;
  if (o.callsNative != callsNative) {
   return false;
  }
  return o.sets.equals(sets);
 }
}
origin: apache/geode

@Override
public boolean equals(Object other) {
 if (other == this) {
  return true;
 }
 if (!(other instanceof ResultsSet)) {
  return false;
 }
 if (!this.elementType.equals(((ResultsSet) other).elementType)) {
  return false;
 }
 return super.equals(other);
}
origin: gocd/gocd

public boolean equals(Object o) {
  if (o == null) return false;
  if (o.getClass()!=this.getClass()) return false;
  JobStateTransitions that = (JobStateTransitions) o;
  return new HashSet<>(this).equals(new HashSet<>(that));
}
origin: robolectric/robolectric

static int compareSignature(Signature[] signatures1, Signature[] signatures2) {
 if (signatures1 == null) {
  return (signatures2 == null) ? SIGNATURE_NEITHER_SIGNED : SIGNATURE_FIRST_NOT_SIGNED;
 }
 if (signatures2 == null) {
  return SIGNATURE_SECOND_NOT_SIGNED;
 }
 if (signatures1.length != signatures2.length) {
  return SIGNATURE_NO_MATCH;
 }
 HashSet<Signature> signatures1set = new HashSet<>(asList(signatures1));
 HashSet<Signature> signatures2set = new HashSet<>(asList(signatures2));
 return signatures1set.equals(signatures2set) ? SIGNATURE_MATCH : SIGNATURE_NO_MATCH;
}
origin: prestodb/presto

private static boolean groupsOnAllColumns(AggregationNode node, List<Symbol> columns)
{
  return new HashSet<>(node.getGroupingKeys()).equals(new HashSet<>(columns));
}
origin: gocd/gocd

@Override
public boolean equals(Object o) {
  if (this == o) {
    return true;
  }
  if (o == null || getClass() != o.getClass()) {
    return false;
  }
  ScheduleOptions that = (ScheduleOptions) o;
  if (specifiedRevisions != null ? !specifiedRevisions.equals(that.specifiedRevisions) : that.specifiedRevisions != null) {
    return false;
  }
  // `Set` because we explicitly want to ignore ordering while comparing, for tests
  if (variables != null ? !new HashSet<>(variables).equals(new HashSet<>(that.variables)) : that.variables != null) {
    return false;
  }
  return true;
}
origin: spotbugs/spotbugs

@ExpectWarning("EC_UNRELATED_TYPES")
public boolean test(HashSet<Integer> s1, HashSet<String> s2) {
  return s1.equals(s2);
}
@ExpectWarning("GC_UNRELATED_TYPES")
origin: spotbugs/spotbugs

@NoWarning("EC_UNRELATED_TYPES")
public boolean test(HashSet<Integer> s1, TreeSet<Integer> s2) {
  return s1.equals(s2);
}
@ExpectWarning("EC_UNRELATED_TYPES")
origin: spotbugs/spotbugs

@ExpectWarning("EC_UNRELATED_TYPES")
static boolean test3(HashSet<Integer> s, LinkedList<String> lst) {
  return s.equals(lst);
}
origin: spotbugs/spotbugs

@ExpectWarning("EC_UNRELATED_TYPES")
static boolean test1(HashSet<Integer> s, LinkedList<Integer> lst) {
  return s.equals(lst);
}
origin: remkop/picocli

public boolean equals(Object obj) {
  if (obj == this) { return true; }
  if (!(obj instanceof OptionSpec)) { return false; }
  OptionSpec other = (OptionSpec) obj;
  boolean result = super.equalsImpl(other)
      && help == other.help
      && usageHelp == other.usageHelp
      && versionHelp == other.versionHelp
      && order == other.order
      && new HashSet<String>(Arrays.asList(names)).equals(new HashSet<String>(Arrays.asList(other.names)));
  return result;
}
public int hashCode() {
origin: com.h2database/h2

private static boolean canUseUniqueIndex(Index idx, Table table, IndexColumn[] cols) {
  if (idx.getTable() != table || !idx.getIndexType().isUnique()) {
    return false;
  }
  Column[] indexCols = idx.getColumns();
  HashSet<Column> indexColsSet = new HashSet<>();
  Collections.addAll(indexColsSet, indexCols);
  HashSet<Column> colsSet = new HashSet<>();
  for (IndexColumn c : cols) {
    colsSet.add(c.column);
  }
  return colsSet.equals(indexColsSet);
}
origin: google/guava

public void testEquals_bothDefaultOrdering() {
 SortedSet<String> set = of("a", "b", "c");
 assertEquals(set, Sets.newTreeSet(asList("a", "b", "c")));
 assertEquals(Sets.newTreeSet(asList("a", "b", "c")), set);
 assertFalse(set.equals(Sets.newTreeSet(asList("a", "b", "d"))));
 assertFalse(Sets.newTreeSet(asList("a", "b", "d")).equals(set));
 assertFalse(set.equals(Sets.newHashSet(4, 5, 6)));
 assertFalse(Sets.newHashSet(4, 5, 6).equals(set));
}
origin: google/guava

public void testEquals_bothExplicitOrdering() {
 SortedSet<String> set = of("in", "the", "a");
 assertEquals(Sets.newTreeSet(asList("in", "the", "a")), set);
 assertFalse(set.equals(Sets.newTreeSet(asList("in", "the", "house"))));
 assertFalse(Sets.newTreeSet(asList("in", "the", "house")).equals(set));
 assertFalse(set.equals(Sets.newHashSet(4, 5, 6)));
 assertFalse(Sets.newHashSet(4, 5, 6).equals(set));
 Set<String> complex = Sets.newTreeSet(STRING_LENGTH);
 Collections.addAll(complex, "in", "the", "a");
 assertEquals(set, complex);
}
origin: com.h2database/h2

private static ConstraintUnique lookupUniqueForReferential(ConstraintReferential referential) {
  Table table = referential.getRefTable();
  for (Constraint c : table.getConstraints()) {
    if (c.getConstraintType() == Constraint.Type.UNIQUE) {
      ConstraintUnique unique = (ConstraintUnique) c;
      if (unique.getReferencedColumns(table).equals(referential.getReferencedColumns(table))) {
        return unique;
      }
    }
  }
  return null;
}
origin: prestodb/presto

public PlanNode replace(int group, PlanNode node, String reason)
{
  PlanNode old = getGroup(group).membership;
  checkArgument(new HashSet<>(old.getOutputSymbols()).equals(new HashSet<>(node.getOutputSymbols())),
      "%s: transformed expression doesn't produce same outputs: %s vs %s",
      reason,
      old.getOutputSymbols(),
      node.getOutputSymbols());
  if (node instanceof GroupReference) {
    node = getNode(((GroupReference) node).getGroupId());
  }
  else {
    node = insertChildrenAndRewrite(node);
  }
  incrementReferenceCounts(node, group);
  getGroup(group).membership = node;
  decrementReferenceCounts(old, group);
  evictStatisticsAndCost(group);
  return node;
}
java.utilHashSetequals

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
  • clone
    Returns a shallow copy of this HashSet instance: the elements themselves are not cloned.
  • removeAll,
  • clone,
  • retainAll,
  • stream,
  • containsAll,
  • forEach,
  • hashCode,
  • toString,
  • removeIf

Popular in Java

  • Making http requests using okhttp
  • scheduleAtFixedRate (Timer)
  • startActivity (Activity)
  • getSupportFragmentManager (FragmentActivity)
  • Color (java.awt)
    The Color class is used to encapsulate colors in the default sRGB color space or colors in arbitrary
  • Date (java.util)
    A specific moment in time, with millisecond precision. Values typically come from System#currentTime
  • Locale (java.util)
    Locale represents a language/country/variant combination. Locales are used to alter the presentatio
  • Queue (java.util)
    A collection designed for holding elements prior to processing. Besides basic java.util.Collection o
  • Loader (org.hibernate.loader)
    Abstract superclass of object loading (and querying) strategies. This class implements useful common
  • SAXParseException (org.xml.sax)
    Encapsulate an XML parse error or warning.> This module, both source code and documentation, is in t
  • Top Vim 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