Tabnine Logo
Maps$SortedMapDifferenceImpl
Code IndexAdd Tabnine to your IDE (free)

How to use
Maps$SortedMapDifferenceImpl
in
com.google.common.collect

Best Java code snippets using com.google.common.collect.Maps$SortedMapDifferenceImpl (Showing top 14 results out of 315)

origin: wildfly/wildfly

/**
 * Computes the difference between two sorted maps, using the comparator of the left map, or
 * {@code Ordering.natural()} if the left map uses the natural ordering of its elements. This
 * difference is an immutable snapshot of the state of the maps at the time this method is called.
 * It will never change, even if the maps change at a later time.
 *
 * <p>Since this method uses {@code TreeMap} instances internally, the keys of the right map must
 * all compare as distinct according to the comparator of the left map.
 *
 * <p><b>Note:</b>If you only need to know whether two sorted maps have the same mappings, call
 * {@code left.equals(right)} instead of this method.
 *
 * @param left the map to treat as the "left" map for purposes of comparison
 * @param right the map to treat as the "right" map for purposes of comparison
 * @return the difference between the two maps
 * @since 11.0
 */
public static <K, V> SortedMapDifference<K, V> difference(
  SortedMap<K, ? extends V> left, Map<? extends K, ? extends V> right) {
 checkNotNull(left);
 checkNotNull(right);
 Comparator<? super K> comparator = orNaturalOrder(left.comparator());
 SortedMap<K, V> onlyOnLeft = Maps.newTreeMap(comparator);
 SortedMap<K, V> onlyOnRight = Maps.newTreeMap(comparator);
 onlyOnRight.putAll(right); // will whittle it down
 SortedMap<K, V> onBoth = Maps.newTreeMap(comparator);
 SortedMap<K, MapDifference.ValueDifference<V>> differences = Maps.newTreeMap(comparator);
 doDifference(left, right, Equivalence.equals(), onlyOnLeft, onlyOnRight, onBoth, differences);
 return new SortedMapDifferenceImpl<>(onlyOnLeft, onlyOnRight, onBoth, differences);
}
origin: com.ning.billing/killbill-osgi-bundles-jruby

  Maps.newTreeMap(comparator);
doDifference(left, right, Equivalence.equals(), onlyOnLeft, onlyOnRight, onBoth, differences);
return new SortedMapDifferenceImpl<K, V>(onlyOnLeft, onlyOnRight, onBoth, differences);
origin: com.google.guava/guava-jdk5

  Maps.newTreeMap(comparator);
doDifference(left, right, Equivalence.equals(), onlyOnLeft, onlyOnRight, onBoth, differences);
return new SortedMapDifferenceImpl<K, V>(onlyOnLeft, onlyOnRight, onBoth, differences);
origin: com.diffplug.guava/guava-collect

SortedMap<K, MapDifference.ValueDifference<V>> differences = Maps.newTreeMap(comparator);
doDifference(left, right, Equivalence.equals(), onlyOnLeft, onlyOnRight, onBoth, differences);
return new SortedMapDifferenceImpl<K, V>(onlyOnLeft, onlyOnRight, onBoth, differences);
origin: org.kill-bill.billing/killbill-osgi-bundles-jruby

  Maps.newTreeMap(comparator);
doDifference(left, right, Equivalence.equals(), onlyOnLeft, onlyOnRight, onBoth, differences);
return new SortedMapDifferenceImpl<K, V>(onlyOnLeft, onlyOnRight, onBoth, differences);
origin: com.ning.billing/killbill-osgi-bundles-analytics

  Maps.newTreeMap(comparator);
doDifference(left, right, Equivalence.equals(), onlyOnLeft, onlyOnRight, onBoth, differences);
return new SortedMapDifferenceImpl<K, V>(onlyOnLeft, onlyOnRight, onBoth, differences);
origin: at.bestsolution.efxclipse.eclipse/com.google.guava

  Maps.newTreeMap(comparator);
doDifference(left, right, Equivalence.equals(), onlyOnLeft, onlyOnRight, onBoth, differences);
return new SortedMapDifferenceImpl<K, V>(onlyOnLeft, onlyOnRight, onBoth, differences);
origin: org.jboss.eap/wildfly-client-all

/**
 * Computes the difference between two sorted maps, using the comparator of the left map, or
 * {@code Ordering.natural()} if the left map uses the natural ordering of its elements. This
 * difference is an immutable snapshot of the state of the maps at the time this method is called.
 * It will never change, even if the maps change at a later time.
 *
 * <p>Since this method uses {@code TreeMap} instances internally, the keys of the right map must
 * all compare as distinct according to the comparator of the left map.
 *
 * <p><b>Note:</b>If you only need to know whether two sorted maps have the same mappings, call
 * {@code left.equals(right)} instead of this method.
 *
 * @param left the map to treat as the "left" map for purposes of comparison
 * @param right the map to treat as the "right" map for purposes of comparison
 * @return the difference between the two maps
 * @since 11.0
 */
public static <K, V> SortedMapDifference<K, V> difference(
  SortedMap<K, ? extends V> left, Map<? extends K, ? extends V> right) {
 checkNotNull(left);
 checkNotNull(right);
 Comparator<? super K> comparator = orNaturalOrder(left.comparator());
 SortedMap<K, V> onlyOnLeft = Maps.newTreeMap(comparator);
 SortedMap<K, V> onlyOnRight = Maps.newTreeMap(comparator);
 onlyOnRight.putAll(right); // will whittle it down
 SortedMap<K, V> onBoth = Maps.newTreeMap(comparator);
 SortedMap<K, MapDifference.ValueDifference<V>> differences = Maps.newTreeMap(comparator);
 doDifference(left, right, Equivalence.equals(), onlyOnLeft, onlyOnRight, onBoth, differences);
 return new SortedMapDifferenceImpl<>(onlyOnLeft, onlyOnRight, onBoth, differences);
}
origin: org.kill-bill.billing/killbill-platform-osgi-bundles-logger

/**
 * Computes the difference between two sorted maps, using the comparator of the left map, or
 * {@code Ordering.natural()} if the left map uses the natural ordering of its elements. This
 * difference is an immutable snapshot of the state of the maps at the time this method is called.
 * It will never change, even if the maps change at a later time.
 *
 * <p>Since this method uses {@code TreeMap} instances internally, the keys of the right map must
 * all compare as distinct according to the comparator of the left map.
 *
 * <p><b>Note:</b>If you only need to know whether two sorted maps have the same mappings, call
 * {@code left.equals(right)} instead of this method.
 *
 * @param left the map to treat as the "left" map for purposes of comparison
 * @param right the map to treat as the "right" map for purposes of comparison
 * @return the difference between the two maps
 * @since 11.0
 */
public static <K, V> SortedMapDifference<K, V> difference(
  SortedMap<K, ? extends V> left, Map<? extends K, ? extends V> right) {
 checkNotNull(left);
 checkNotNull(right);
 Comparator<? super K> comparator = orNaturalOrder(left.comparator());
 SortedMap<K, V> onlyOnLeft = Maps.newTreeMap(comparator);
 SortedMap<K, V> onlyOnRight = Maps.newTreeMap(comparator);
 onlyOnRight.putAll(right); // will whittle it down
 SortedMap<K, V> onBoth = Maps.newTreeMap(comparator);
 SortedMap<K, MapDifference.ValueDifference<V>> differences = Maps.newTreeMap(comparator);
 doDifference(left, right, Equivalence.equals(), onlyOnLeft, onlyOnRight, onBoth, differences);
 return new SortedMapDifferenceImpl<>(onlyOnLeft, onlyOnRight, onBoth, differences);
}
origin: Nextdoor/bender

  Maps.newTreeMap(comparator);
doDifference(left, right, Equivalence.equals(), onlyOnLeft, onlyOnRight, onBoth, differences);
return new SortedMapDifferenceImpl<K, V>(onlyOnLeft, onlyOnRight, onBoth, differences);
origin: org.sonatype.sisu/sisu-guava

private static <K, V> SortedMapDifference<K, V> sortedMapDifference(
  boolean areEqual, SortedMap<K, V> onlyOnLeft, SortedMap<K, V> onlyOnRight,
  SortedMap<K, V> onBoth, SortedMap<K, ValueDifference<V>> differences) {
 return new SortedMapDifferenceImpl<K, V>(areEqual,
   Collections.unmodifiableSortedMap(onlyOnLeft),
   Collections.unmodifiableSortedMap(onlyOnRight),
   Collections.unmodifiableSortedMap(onBoth),
   Collections.unmodifiableSortedMap(differences));
}
origin: org.hudsonci.lib.guava/guava

private static <K, V> SortedMapDifference<K, V> sortedMapDifference(
  boolean areEqual, SortedMap<K, V> onlyOnLeft, SortedMap<K, V> onlyOnRight,
  SortedMap<K, V> onBoth, SortedMap<K, ValueDifference<V>> differences) {
 return new SortedMapDifferenceImpl<K, V>(areEqual,
   Collections.unmodifiableSortedMap(onlyOnLeft),
   Collections.unmodifiableSortedMap(onlyOnRight),
   Collections.unmodifiableSortedMap(onBoth),
   Collections.unmodifiableSortedMap(differences));
}
origin: google/j2objc

private enum EntryFunction implements Function<Entry<?, ?>, Object> {
 KEY {
  @Override
  @NullableDecl
  public Object apply(Entry<?, ?> entry) {
   return entry.getKey();
  }
 },
 VALUE {
  @Override
  @NullableDecl
  public Object apply(Entry<?, ?> entry) {
   return entry.getValue();
  }
 };
}
origin: google/guava

/**
 * Computes the difference between two sorted maps, using the comparator of the left map, or
 * {@code Ordering.natural()} if the left map uses the natural ordering of its elements. This
 * difference is an immutable snapshot of the state of the maps at the time this method is called.
 * It will never change, even if the maps change at a later time.
 *
 * <p>Since this method uses {@code TreeMap} instances internally, the keys of the right map must
 * all compare as distinct according to the comparator of the left map.
 *
 * <p><b>Note:</b>If you only need to know whether two sorted maps have the same mappings, call
 * {@code left.equals(right)} instead of this method.
 *
 * @param left the map to treat as the "left" map for purposes of comparison
 * @param right the map to treat as the "right" map for purposes of comparison
 * @return the difference between the two maps
 * @since 11.0
 */
public static <K, V> SortedMapDifference<K, V> difference(
  SortedMap<K, ? extends V> left, Map<? extends K, ? extends V> right) {
 checkNotNull(left);
 checkNotNull(right);
 Comparator<? super K> comparator = orNaturalOrder(left.comparator());
 SortedMap<K, V> onlyOnLeft = Maps.newTreeMap(comparator);
 SortedMap<K, V> onlyOnRight = Maps.newTreeMap(comparator);
 onlyOnRight.putAll(right); // will whittle it down
 SortedMap<K, V> onBoth = Maps.newTreeMap(comparator);
 SortedMap<K, MapDifference.ValueDifference<V>> differences = Maps.newTreeMap(comparator);
 doDifference(left, right, Equivalence.equals(), onlyOnLeft, onlyOnRight, onBoth, differences);
 return new SortedMapDifferenceImpl<>(onlyOnLeft, onlyOnRight, onBoth, differences);
}
com.google.common.collectMaps$SortedMapDifferenceImpl

Most used methods

  • <init>

Popular in Java

  • Parsing JSON documents to java classes using gson
  • scheduleAtFixedRate (Timer)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • findViewById (Activity)
  • GridLayout (java.awt)
    The GridLayout class is a layout manager that lays out a container's components in a rectangular gri
  • Menu (java.awt)
  • ServerSocket (java.net)
    This class represents a server-side socket that waits for incoming client connections. A ServerSocke
  • MessageFormat (java.text)
    Produces concatenated messages in language-neutral way. New code should probably use java.util.Forma
  • Properties (java.util)
    A Properties object is a Hashtable where the keys and values must be Strings. Each property can have
  • Servlet (javax.servlet)
    Defines methods that all servlets must implement. A servlet is a small Java program that runs within
  • Best IntelliJ 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