congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
Multiset.equals
Code IndexAdd Tabnine to your IDE (free)

How to use
equals
method
in
com.google.common.collect.Multiset

Best Java code snippets using com.google.common.collect.Multiset.equals (Showing top 20 results out of 315)

origin: google/guava

 /** Returns {@code true} if the second list is a permutation of the first. */
 private static boolean isPermutation(List<?> first, List<?> second) {
  if (first.size() != second.size()) {
   return false;
  }
  Multiset<?> firstMultiset = HashMultiset.create(first);
  Multiset<?> secondMultiset = HashMultiset.create(second);
  return firstMultiset.equals(secondMultiset);
 }
}
origin: google/guava

@Override
public boolean equals(Object o) {
 if (o == this) {
  return true;
 }
 synchronized (mutex) {
  return delegate().equals(o);
 }
}
origin: wildfly/wildfly

 /** Returns {@code true} if the second list is a permutation of the first. */
 private static boolean isPermutation(List<?> first, List<?> second) {
  if (first.size() != second.size()) {
   return false;
  }
  Multiset<?> firstMultiset = HashMultiset.create(first);
  Multiset<?> secondMultiset = HashMultiset.create(second);
  return firstMultiset.equals(secondMultiset);
 }
}
origin: google/j2objc

@Override
public boolean equals(Object o) {
 if (o == this) {
  return true;
 }
 synchronized (mutex) {
  return delegate().equals(o);
 }
}
origin: google/guava

@Override
public boolean equals(@Nullable Object object) {
 return object == this || delegate().equals(object);
}
origin: google/guava

public void testEquals_yes() {
 assertTrue(
   "multiset doesn't equal a multiset with the same elements",
   getMultiset().equals(HashMultiset.create(getSampleElements())));
}
origin: wildfly/wildfly

@Override
public boolean equals(Object o) {
 if (o == this) {
  return true;
 }
 synchronized (mutex) {
  return delegate().equals(o);
 }
}
origin: google/guava

public void testEquals_differentSize() {
 Multiset<E> other = HashMultiset.create(getSampleElements());
 other.add(e0());
 assertFalse("multiset equals a multiset with a different size", getMultiset().equals(other));
}
origin: prestodb/presto

  public void sanityCheck()
  {
    Multiset<PlanFragmentId> exchangeIds = fragment.getRemoteSourceNodes().stream()
        .map(RemoteSourceNode::getSourceFragmentIds)
        .flatMap(List::stream)
        .collect(toImmutableMultiset());

    Multiset<PlanFragmentId> childrenIds = children.stream()
        .map(SubPlan::getFragment)
        .map(PlanFragment::getId)
        .collect(toImmutableMultiset());

    Preconditions.checkState(exchangeIds.equals(childrenIds), "Subplan exchange ids don't match child fragment ids (%s vs %s)", exchangeIds, childrenIds);

    for (SubPlan child : children) {
      child.sanityCheck();
    }
  }
}
origin: google/j2objc

@Override
public boolean equals(@NullableDecl Object object) {
 return object == this || delegate().equals(object);
}
origin: google/guava

@CollectionSize.Require(absent = ZERO)
public void testEquals_differentElements() {
 Multiset<E> other = HashMultiset.create(getSampleElements());
 other.remove(e0());
 other.add(e3());
 assertFalse("multiset equals a multiset with different elements", getMultiset().equals(other));
}
origin: wildfly/wildfly

@Override
public boolean equals(@NullableDecl Object object) {
 return object == this || delegate().equals(object);
}
origin: apache/hive

Multiset<String> conjsOp1String = extractConjsIgnoringDPPPreds(op1Conf.getPredicate());
Multiset<String> conjsOp2String = extractConjsIgnoringDPPPreds(op2Conf.getPredicate());
if (conjsOp1String.equals(conjsOp2String)) {
 equalFilters = true;
origin: google/guava

public void testToMultisetCountFunction() {
 BiPredicate<Multiset<String>, Multiset<String>> equivalence =
   (ms1, ms2) ->
     ms1.equals(ms2)
       && ImmutableList.copyOf(ms1.entrySet())
         .equals(ImmutableList.copyOf(ms2.entrySet()));
 CollectorTester.of(
     Multisets.<Multiset.Entry<String>, String, Multiset<String>>toMultiset(
       Multiset.Entry::getElement, Multiset.Entry::getCount, LinkedHashMultiset::create),
     equivalence)
   .expectCollects(ImmutableMultiset.<String>of())
   .expectCollects(
     ImmutableMultiset.of("a", "a", "b", "c", "c", "c"),
     Multisets.immutableEntry("a", 1),
     Multisets.immutableEntry("b", 1),
     Multisets.immutableEntry("a", 1),
     Multisets.immutableEntry("c", 3));
}
origin: org.hudsonci.lib.guava/guava

/**
 * Returns {@code true} if the second list is a permutation of the first.
 */
private static boolean isPermutation(List<?> first,
  List<?> second) {
 if (first.size() != second.size()) {
  return false;
 }
 Multiset<?> firstSet = HashMultiset.create(first);
 Multiset<?> secondSet = HashMultiset.create(second);
 return firstSet.equals(secondSet);
}
origin: com.google.guava/guava-jdk5

@Override public boolean equals(Object o) {
 if (o == this) {
  return true;
 }
 synchronized (mutex) {
  return delegate().equals(o);
 }
}
origin: at.bestsolution.efxclipse.eclipse/com.google.guava

@Override public boolean equals(Object o) {
 if (o == this) {
  return true;
 }
 synchronized (mutex) {
  return delegate().equals(o);
 }
}
origin: org.jboss.eap/wildfly-client-all

@Override
public boolean equals(Object o) {
 if (o == this) {
  return true;
 }
 synchronized (mutex) {
  return delegate().equals(o);
 }
}
origin: com.diffplug.guava/guava-collect

@Override
public boolean equals(Object o) {
  if (o == this) {
    return true;
  }
  synchronized (mutex) {
    return delegate().equals(o);
  }
}
origin: com.google.guava/guava-testlib

public void testEquals_yes() {
 assertTrue(
   "multiset doesn't equal a multiset with the same elements",
   getMultiset().equals(HashMultiset.create(getSampleElements())));
}
com.google.common.collectMultisetequals

Javadoc

Compares the specified object with this multiset for equality. Returns true if the given object is also a multiset and contains equal elements with equal counts, regardless of order.

Popular methods of Multiset

  • add
    Adds a number of occurrences of an element to this multiset. Note that if occurrences == 1, this met
  • count
    Returns the number of occurrences of an element in this multiset (thecount of the element). Note tha
  • elementSet
    Returns the set of distinct elements contained in this multiset. The element set is backed by the sa
  • entrySet
    Returns a view of the contents of this multiset, grouped into Multiset.Entry instances, each providi
  • remove
    Removes a number of occurrences of the specified element from this multiset. If the multiset contain
  • size
    Returns the total number of all occurrences of all elements in this multiset. Note: this method does
  • isEmpty
  • clear
  • contains
    Determines whether this multiset contains the specified element.This method refines Collection#conta
  • addAll
  • setCount
    Conditionally sets the count of an element to a new value, as described in #setCount(Object,int), pr
  • iterator
    Elements that occur multiple times in the multiset will appear multiple times in this iterator, thou
  • setCount,
  • iterator,
  • containsAll,
  • hashCode,
  • removeAll,
  • toString,
  • stream,
  • forEachEntry,
  • retainAll

Popular in Java

  • Updating database using SQL prepared statement
  • putExtra (Intent)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • requestLocationUpdates (LocationManager)
  • BufferedReader (java.io)
    Wraps an existing Reader and buffers the input. Expensive interaction with the underlying reader is
  • EOFException (java.io)
    Thrown when a program encounters the end of a file or stream during an input operation.
  • SimpleDateFormat (java.text)
    Formats and parses dates in a locale-sensitive manner. Formatting turns a Date into a String, and pa
  • Date (java.util)
    A specific moment in time, with millisecond precision. Values typically come from System#currentTime
  • TimeUnit (java.util.concurrent)
    A TimeUnit represents time durations at a given unit of granularity and provides utility methods to
  • JPanel (javax.swing)
  • Top plugins for WebStorm
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