Tabnine Logo
RegularImmutableMultiset
Code IndexAdd Tabnine to your IDE (free)

How to use
RegularImmutableMultiset
in
com.google.common.collect

Best Java code snippets using com.google.common.collect.RegularImmutableMultiset (Showing top 18 results out of 315)

origin: google/guava

Multisets.ImmutableEntry<E>[] entryArray = new Multisets.ImmutableEntry[distinct];
if (distinct == 0) {
 return new RegularImmutableMultiset<>(entryArray, null, 0, 0, ImmutableSet.of());
return hashFloodingDetected(hashTable)
  ? JdkBackedImmutableMultiset.create(ImmutableList.asImmutableList(entryArray))
  : new RegularImmutableMultiset<E>(
    entryArray, hashTable, Ints.saturatedCast(size), hashCode, null);
origin: google/guava

static <E> ImmutableMultiset<E> copyFromEntries(
  Collection<? extends Entry<? extends E>> entries) {
 if (entries.isEmpty()) {
  return of();
 } else {
  return RegularImmutableMultiset.create(entries);
 }
}
origin: com.diffplug.guava/guava-collect

static <E> ImmutableMultiset<E> copyFromEntries(
    Collection<? extends Entry<? extends E>> entries) {
  if (entries.isEmpty()) {
    return of();
  } else {
    return new RegularImmutableMultiset<E>(entries);
  }
}
origin: com.google.guava/guava-jdk5

static <E> ImmutableMultiset<E> copyFromEntries(
  Collection<? extends Entry<? extends E>> entries) {
 long size = 0;
 ImmutableMap.Builder<E, Integer> builder = ImmutableMap.builder();
 for (Entry<? extends E> entry : entries) {
  int count = entry.getCount();
  if (count > 0) {
   // Since ImmutableMap.Builder throws an NPE if an element is null, no
   // other null checks are needed.
   builder.put(entry.getElement(), count);
   size += count;
  }
 }
 if (size == 0) {
  return of();
 }
 return new RegularImmutableMultiset<E>(
   builder.build(), Ints.saturatedCast(size));
}
origin: org.hudsonci.lib.guava/guava

static <E> ImmutableMultiset<E> copyFromEntries(
  Collection<? extends Entry<? extends E>> entries) {
 long size = 0;
 ImmutableMap.Builder<E, Integer> builder = ImmutableMap.builder();
 for (Entry<? extends E> entry : entries) {
  int count = entry.getCount();
  if (count > 0) {
   // Since ImmutableMap.Builder throws an NPE if an element is null, no
   // other null checks are needed.
   builder.put(entry.getElement(), count);
   size += count;
  }
 }
 if (size == 0) {
  return of();
 }
 return new RegularImmutableMultiset<E>(
   builder.build(), Ints.saturatedCast(size));
}
origin: wildfly/wildfly

Multisets.ImmutableEntry<E>[] entryArray = new Multisets.ImmutableEntry[distinct];
if (distinct == 0) {
 return new RegularImmutableMultiset<>(entryArray, null, 0, 0, ImmutableSet.of());
return hashFloodingDetected(hashTable)
  ? JdkBackedImmutableMultiset.create(ImmutableList.asImmutableList(entryArray))
  : new RegularImmutableMultiset<E>(
    entryArray, hashTable, Ints.saturatedCast(size), hashCode, null);
origin: wildfly/wildfly

static <E> ImmutableMultiset<E> copyFromEntries(
  Collection<? extends Entry<? extends E>> entries) {
 if (entries.isEmpty()) {
  return of();
 } else {
  return RegularImmutableMultiset.create(entries);
 }
}
origin: Nextdoor/bender

static <E> ImmutableMultiset<E> copyFromEntries(
  Collection<? extends Entry<? extends E>> entries) {
 long size = 0;
 ImmutableMap.Builder<E, Integer> builder = ImmutableMap.builder();
 for (Entry<? extends E> entry : entries) {
  int count = entry.getCount();
  if (count > 0) {
   // Since ImmutableMap.Builder throws an NPE if an element is null, no
   // other null checks are needed.
   builder.put(entry.getElement(), count);
   size += count;
  }
 }
 if (size == 0) {
  return of();
 }
 return new RegularImmutableMultiset<E>(
   builder.build(), Ints.saturatedCast(size));
}
origin: org.jboss.eap/wildfly-client-all

Multisets.ImmutableEntry<E>[] entryArray = new Multisets.ImmutableEntry[distinct];
if (distinct == 0) {
 return new RegularImmutableMultiset<>(entryArray, null, 0, 0, ImmutableSet.of());
return hashFloodingDetected(hashTable)
  ? JdkBackedImmutableMultiset.create(ImmutableList.asImmutableList(entryArray))
  : new RegularImmutableMultiset<E>(
    entryArray, hashTable, Ints.saturatedCast(size), hashCode, null);
origin: google/j2objc

class RegularImmutableMultiset<E> extends ImmutableMultiset<E> {
 static final RegularImmutableMultiset<Object> EMPTY =
   new RegularImmutableMultiset<>(ObjectCountHashMap.create());
origin: com.ning.billing/killbill-osgi-bundles-analytics

static <E> ImmutableMultiset<E> copyFromEntries(
  Collection<? extends Entry<? extends E>> entries) {
 long size = 0;
 ImmutableMap.Builder<E, Integer> builder = ImmutableMap.builder();
 for (Entry<? extends E> entry : entries) {
  int count = entry.getCount();
  if (count > 0) {
   // Since ImmutableMap.Builder throws an NPE if an element is null, no
   // other null checks are needed.
   builder.put(entry.getElement(), count);
   size += count;
  }
 }
 if (size == 0) {
  return of();
 }
 return new RegularImmutableMultiset<E>(
   builder.build(), Ints.saturatedCast(size));
}
origin: org.kill-bill.billing/killbill-platform-osgi-bundles-logger

Multisets.ImmutableEntry<E>[] entryArray = new Multisets.ImmutableEntry[distinct];
if (distinct == 0) {
 return new RegularImmutableMultiset<>(entryArray, null, 0, 0, ImmutableSet.of());
return hashFloodingDetected(hashTable)
  ? JdkBackedImmutableMultiset.create(ImmutableList.asImmutableList(entryArray))
  : new RegularImmutableMultiset<E>(
    entryArray, hashTable, Ints.saturatedCast(size), hashCode, null);
origin: org.jboss.eap/wildfly-client-all

static <E> ImmutableMultiset<E> copyFromEntries(
  Collection<? extends Entry<? extends E>> entries) {
 if (entries.isEmpty()) {
  return of();
 } else {
  return RegularImmutableMultiset.create(entries);
 }
}
origin: org.sonatype.sisu/sisu-guava

static <E> ImmutableMultiset<E> copyFromEntries(
  Collection<? extends Entry<? extends E>> entries) {
 long size = 0;
 ImmutableMap.Builder<E, Integer> builder = ImmutableMap.builder();
 for (Entry<? extends E> entry : entries) {
  int count = entry.getCount();
  if (count > 0) {
   // Since ImmutableMap.Builder throws an NPE if an element is null, no
   // other null checks are needed.
   builder.put(entry.getElement(), count);
   size += count;
  }
 }
 if (size == 0) {
  return of();
 }
 return new RegularImmutableMultiset<E>(builder.build(), Ints.saturatedCast(size));
}
origin: org.kill-bill.billing/killbill-platform-osgi-bundles-logger

static <E> ImmutableMultiset<E> copyFromEntries(
  Collection<? extends Entry<? extends E>> entries) {
 if (entries.isEmpty()) {
  return of();
 } else {
  return RegularImmutableMultiset.create(entries);
 }
}
origin: at.bestsolution.efxclipse.eclipse/com.google.guava

static <E> ImmutableMultiset<E> copyFromEntries(
  Collection<? extends Entry<? extends E>> entries) {
 long size = 0;
 ImmutableMap.Builder<E, Integer> builder = ImmutableMap.builder();
 for (Entry<? extends E> entry : entries) {
  int count = entry.getCount();
  if (count > 0) {
   // Since ImmutableMap.Builder throws an NPE if an element is null, no
   // other null checks are needed.
   builder.put(entry.getElement(), count);
   size += count;
  }
 }
 if (size == 0) {
  return of();
 }
 return new RegularImmutableMultiset<E>(
   builder.build(), Ints.saturatedCast(size));
}
origin: com.ning.billing/killbill-osgi-bundles-jruby

static <E> ImmutableMultiset<E> copyFromEntries(
  Collection<? extends Entry<? extends E>> entries) {
 long size = 0;
 ImmutableMap.Builder<E, Integer> builder = ImmutableMap.builder();
 for (Entry<? extends E> entry : entries) {
  int count = entry.getCount();
  if (count > 0) {
   // Since ImmutableMap.Builder throws an NPE if an element is null, no
   // other null checks are needed.
   builder.put(entry.getElement(), count);
   size += count;
  }
 }
 if (size == 0) {
  return of();
 }
 return new RegularImmutableMultiset<E>(
   builder.build(), Ints.saturatedCast(size));
}
origin: org.kill-bill.billing/killbill-osgi-bundles-jruby

static <E> ImmutableMultiset<E> copyFromEntries(
  Collection<? extends Entry<? extends E>> entries) {
 long size = 0;
 ImmutableMap.Builder<E, Integer> builder = ImmutableMap.builder();
 for (Entry<? extends E> entry : entries) {
  int count = entry.getCount();
  if (count > 0) {
   // Since ImmutableMap.Builder throws an NPE if an element is null, no
   // other null checks are needed.
   builder.put(entry.getElement(), count);
   size += count;
  }
 }
 if (size == 0) {
  return of();
 }
 return new RegularImmutableMultiset<E>(
   builder.build(), Ints.saturatedCast(size));
}
com.google.common.collectRegularImmutableMultiset

Javadoc

Implementation of ImmutableMultiset with zero or more elements.

Most used methods

  • <init>
  • create
  • hashFloodingDetected

Popular in Java

  • Running tasks concurrently on multiple threads
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • compareTo (BigDecimal)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • HttpServer (com.sun.net.httpserver)
    This class implements a simple HTTP server. A HttpServer is bound to an IP address and port number a
  • VirtualMachine (com.sun.tools.attach)
    A Java virtual machine. A VirtualMachine represents a Java virtual machine to which this Java vir
  • System (java.lang)
    Provides access to system-related information and resources including standard input and output. Ena
  • SQLException (java.sql)
    An exception that indicates a failed JDBC operation. It provides the following information about pro
  • PriorityQueue (java.util)
    A PriorityQueue holds elements on a priority heap, which orders the elements according to their natu
  • BlockingQueue (java.util.concurrent)
    A java.util.Queue that additionally supports operations that wait for the queue to become non-empty
  • 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