java.util.AbstractSet.equals()方法的使用及代码示例

x33g5p2x  于2022-01-15 转载在 其他  
字(5.2k)|赞(0)|评价(0)|浏览(122)

本文整理了Java中java.util.AbstractSet.equals()方法的一些代码示例,展示了AbstractSet.equals()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。AbstractSet.equals()方法的具体详情如下:
包路径:java.util.AbstractSet
类名称:AbstractSet
方法名:equals

AbstractSet.equals介绍

[英]Compares the specified object to this Set and returns true if they are equal. The object must be an instance of Set and contain the same objects.
[中]将指定对象与此集合进行比较,如果它们相等,则返回true。对象必须是集合的实例,并且包含相同的对象。

代码示例

代码示例来源:origin: google/guava

@Override
public boolean equals(@Nullable Object obj) {
 if (obj instanceof PowerSet) {
  PowerSet<?> that = (PowerSet<?>) obj;
  return inputSet.equals(that.inputSet);
 }
 return super.equals(obj);
}

代码示例来源:origin: prestodb/presto

@Override
public boolean equals(@NullableDecl Object obj) {
 if (obj instanceof PowerSet) {
  PowerSet<?> that = (PowerSet<?>) obj;
  return inputSet.equals(that.inputSet);
 }
 return super.equals(obj);
}

代码示例来源:origin: wildfly/wildfly

@Override
public boolean equals(@NullableDecl Object obj) {
 if (obj instanceof PowerSet) {
  PowerSet<?> that = (PowerSet<?>) obj;
  return inputSet.equals(that.inputSet);
 }
 return super.equals(obj);
}

代码示例来源:origin: geotools/geotools

/**
 * Compare this set with the specified object for equality.
 *
 * @param set The object to compare with this set for equality.
 */
@Override
public boolean equals(final Object set) {
  synchronized (map) {
    return super.equals(set);
  }
}

代码示例来源:origin: stackoverflow.com

public static boolean compareArrays(Integer[] arr1, Integer[] arr2) {
  HashSet<Integer> set1 = new HashSet<Integer>(Arrays.asList(arr1));
  HashSet<Integer> set2 = new HashSet<Integer>(Arrays.asList(arr2));
  return set1.equals(set2);
}

代码示例来源:origin: stackoverflow.com

new HashSet(arrayList1) . equals (new HashSet(arrayList2))

代码示例来源:origin: stackoverflow.com

package resolver;

import java.util.EnumSet;

public class EnumPatternExample {

  public enum Style {
    BOLD, ITALIC, UNDERLINE, STRIKETHROUGH
  }

  public static void main(String[] args) {
    final EnumSet<Style> styles = EnumSet.noneOf(Style.class);
    styles.addAll(EnumSet.range(Style.BOLD, Style.STRIKETHROUGH)); // enable all constants
    styles.removeAll(EnumSet.of(Style.UNDERLINE, Style.STRIKETHROUGH)); // disable a couple
    assert EnumSet.of(Style.BOLD, Style.ITALIC).equals(styles); // check set contents are correct
    System.out.println(styles);
  }

}

代码示例来源:origin: kite-sdk/kite

@Override
public boolean equals(Object o) {
 // satisfy findbugs. AbstractSet#equals is correct and based on contains
 return super.equals(o);
}

代码示例来源:origin: com.github.veithen.cosmos/cosmos-equinox

@Override
public boolean equals(Object o) {
  if (o instanceof CopyOnWriteSet && ((CopyOnWriteSet) o).data == data) {
    return true;
  }
  return super.equals(o);
}

代码示例来源:origin: org.xwiki.platform/xwiki-platform-security-api

@Override
public boolean equals(Object o)
{
  if (!(o instanceof RightSet)) {
    return super.equals(o);
  }
  return ((RightSet) o).rights == rights;
}

代码示例来源:origin: com.google.guava/guava-collections

@Override public boolean equals(@Nullable Object object) {
 // Warning: this is broken if size() == 0, so it is critical that we
 // substitute an empty ImmutableSet to the user in place of this
 if (object instanceof CartesianSet<?>) {
  CartesianSet<?> that = (CartesianSet) object;
  return this.axes.equals(that.axes);
 }
 return super.equals(object);
}

代码示例来源:origin: io.prestosql.hadoop/hadoop-apache

@Override public boolean equals(@Nullable Object obj) {
 if (obj instanceof PowerSet) {
  PowerSet<?> that = (PowerSet<?>) obj;
  return inputSet.equals(that.inputSet);
 }
 return super.equals(obj);
}

代码示例来源:origin: com.alibaba.edas.acm/acm-sdk

@Override
public boolean equals(@Nullable Object obj) {
 if (obj instanceof PowerSet) {
  PowerSet<?> that = (PowerSet<?>) obj;
  return inputSet.equals(that.inputSet);
 }
 return super.equals(obj);
}

代码示例来源:origin: com.diffplug.guava/guava-collect

@Override
public boolean equals(@Nullable Object obj) {
  if (obj instanceof PowerSet) {
    PowerSet<?> that = (PowerSet<?>) obj;
    return inputSet.equals(that.inputSet);
  }
  return super.equals(obj);
}

代码示例来源:origin: com.facebook.presto.hive/hive-apache-jdbc

@Override public boolean equals(@Nullable Object obj) {
 if (obj instanceof PowerSet) {
  PowerSet<?> that = (PowerSet<?>) obj;
  return inputSet.equals(that.inputSet);
 }
 return super.equals(obj);
}

代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby

@Override public boolean equals(@Nullable Object obj) {
 if (obj instanceof PowerSet) {
  PowerSet<?> that = (PowerSet<?>) obj;
  return inputSet.equals(that.inputSet);
 }
 return super.equals(obj);
}

代码示例来源:origin: org.apache.hbase.thirdparty/hbase-shaded-miscellaneous

@Override
public boolean equals(@Nullable Object obj) {
 if (obj instanceof PowerSet) {
  PowerSet<?> that = (PowerSet<?>) obj;
  return inputSet.equals(that.inputSet);
 }
 return super.equals(obj);
}

代码示例来源:origin: org.sonatype.sisu/sisu-guava

@Override public boolean equals(@Nullable Object obj) {
 if (obj instanceof PowerSet) {
  PowerSet<?> that = (PowerSet<?>) obj;
  return inputSet.equals(that.inputSet);
 }
 return super.equals(obj);
}

代码示例来源:origin: com.facebook.presto/presto-jdbc

@Override
public boolean equals(@NullableDecl Object obj) {
 if (obj instanceof PowerSet) {
  PowerSet<?> that = (PowerSet<?>) obj;
  return inputSet.equals(that.inputSet);
 }
 return super.equals(obj);
}

代码示例来源:origin: prestosql/presto

@Override
public boolean equals(@Nullable Object obj) {
 if (obj instanceof PowerSet) {
  PowerSet<?> that = (PowerSet<?>) obj;
  return inputSet.equals(that.inputSet);
 }
 return super.equals(obj);
}

相关文章