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

How to use
FactoryComparator
in
org.geotools.factory

Best Java code snippets using org.geotools.factory.FactoryComparator (Showing top 4 results out of 315)

origin: org.geotools/gt2-metadata

/**
 * Compares this factory with the specified object for equality.
 * The default implementation returns {@code true} if and only if:
 * <p>
 * <ul>
 *   <li>Both objects are of the exact same class
 *       (a <cite>is instance of</cite> relationship is not enough).</li>
 *   <li>{@linkplain #getImplementationHints implementation hints} are
 *       {@linkplain Map#equals equal}.</li>
 * </ul>
 * <p>
 * The requirement for the <cite>exact same class</cite> is needed for consistency with the
 * {@linkplain FactoryRegistry factory registry} working, since at most one instance of a given
 * class {@linkplain FactoryRegistry#getServiceProviderByClass) is allowed} in a registry.
 *
 * @since 2.3
 */
public final boolean equals(final Object object) {
  if (object == this) {
    return true;
  }
  if (object!=null && object.getClass().equals(getClass())) {
    final AbstractFactory that = (AbstractFactory) object;
    return this.priority == that.priority &&
        new FactoryComparator(this, that).compare(new HashSet());
  }
  return false;
}
origin: org.geotools/gt-metadata

if (this.priority == that.priority) {
  final Set<FactoryComparator> comparators = new HashSet<FactoryComparator>();
  return new FactoryComparator(this, that).compare(comparators);
origin: org.geotools/gt-metadata

/**
 * Returns {@code true} if {@code f1} and {@code f2} are equals.
 *
 * @param done An initially empty set. Used internally for preventing infinite recursivity.
 */
boolean compare(final Set<FactoryComparator> done) {
  if (done.add(this)) {
    final Map<RenderingHints.Key, ?> m1 = f1.getImplementationHints();
    final Map<RenderingHints.Key, ?> m2 = f2.getImplementationHints();
    if (m1.size() != m2.size()) {
      return false;
    }
    for (final Map.Entry<RenderingHints.Key, ?> entry : m1.entrySet()) {
      final Object key = entry.getKey();
      final Object v1  = entry.getValue();
      final Object v2  = m2.get(key);
      if (v1 == v2) continue;
      if (v1 instanceof Factory) {
        if (v2 == null || !v1.getClass().equals(v2.getClass()) ||
          !new FactoryComparator((Factory) v1, (Factory) v2).compare(done))
        {
          return false;
        }
      } else if (!Utilities.equals(v1, v2)) {
        return false;
      }
    }
  }
  return true;
}
origin: org.geotools/gt2-metadata

if (v1 instanceof Factory) {
  if (v2 == null || !v1.getClass().equals(v2.getClass()) ||
    !new FactoryComparator((Factory) v1, (Factory) v2).compare(done))
org.geotools.factoryFactoryComparator

Javadoc

Compares two factories for equality. Used internally for AbstractFactory#equals implementation only.

Most used methods

  • <init>
    Prepare a comparaison between the two specified factories.
  • compare
    Returns true if f1 and f2 are equals.

Popular in Java

  • Finding current android device location
  • setScale (BigDecimal)
  • scheduleAtFixedRate (Timer)
  • onRequestPermissionsResult (Fragment)
  • Pointer (com.sun.jna)
    An abstraction for a native pointer data type. A Pointer instance represents, on the Java side, a na
  • GridBagLayout (java.awt)
    The GridBagLayout class is a flexible layout manager that aligns components vertically and horizonta
  • FileNotFoundException (java.io)
    Thrown when a file specified by a program cannot be found.
  • Locale (java.util)
    Locale represents a language/country/variant combination. Locales are used to alter the presentatio
  • JFileChooser (javax.swing)
  • Get (org.apache.hadoop.hbase.client)
    Used to perform Get operations on a single row. To get everything for a row, instantiate a Get objec
  • 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