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

x33g5p2x  于2022-01-16 转载在 其他  
字(7.8k)|赞(0)|评价(0)|浏览(135)

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

BitSet.equals介绍

[英]Compares this object against the specified object. The result is true if and only if the argument is not null and is a Bitset object that has exactly the same set of bits set to true as this bit set. That is, for every nonnegative int index k,

  1. ((BitSet)obj).get(k) == this.get(k)

must be true. The current sizes of the two bit sets are not compared.
[中]将此对象与指定对象进行比较。当且仅当参数不为null且是与此位集具有完全相同的位集设置为true的位集对象时,结果为true。也就是说,对于每个非负整数索引k,

  1. ((BitSet)obj).get(k) == this.get(k)

必须为真。不比较两个位集的当前大小。

代码示例

代码示例来源:origin: spring-projects/spring-framework

  1. @Override
  2. public boolean equals(Object other) {
  3. if (this == other) {
  4. return true;
  5. }
  6. if (!(other instanceof CronSequenceGenerator)) {
  7. return false;
  8. }
  9. CronSequenceGenerator otherCron = (CronSequenceGenerator) other;
  10. return (this.months.equals(otherCron.months) && this.daysOfMonth.equals(otherCron.daysOfMonth) &&
  11. this.daysOfWeek.equals(otherCron.daysOfWeek) && this.hours.equals(otherCron.hours) &&
  12. this.minutes.equals(otherCron.minutes) && this.seconds.equals(otherCron.seconds));
  13. }

代码示例来源:origin: org.springframework/spring-context

  1. @Override
  2. public boolean equals(Object other) {
  3. if (this == other) {
  4. return true;
  5. }
  6. if (!(other instanceof CronSequenceGenerator)) {
  7. return false;
  8. }
  9. CronSequenceGenerator otherCron = (CronSequenceGenerator) other;
  10. return (this.months.equals(otherCron.months) && this.daysOfMonth.equals(otherCron.daysOfMonth) &&
  11. this.daysOfWeek.equals(otherCron.daysOfWeek) && this.hours.equals(otherCron.hours) &&
  12. this.minutes.equals(otherCron.minutes) && this.seconds.equals(otherCron.seconds));
  13. }

代码示例来源:origin: nutzam/nutz

  1. @Override
  2. public boolean equals(Object other) {
  3. if (this == other) {
  4. return true;
  5. }
  6. if (!(other instanceof CronSequenceGenerator)) {
  7. return false;
  8. }
  9. CronSequenceGenerator otherCron = (CronSequenceGenerator) other;
  10. return (this.months.equals(otherCron.months) && this.daysOfMonth.equals(otherCron.daysOfMonth) &&
  11. this.daysOfWeek.equals(otherCron.daysOfWeek) && this.hours.equals(otherCron.hours) &&
  12. this.minutes.equals(otherCron.minutes) && this.seconds.equals(otherCron.seconds));
  13. }

代码示例来源:origin: ethereum/ethereumj

  1. @Override
  2. public boolean equals(Object obj) {
  3. return obj instanceof BloomFilter && mask.equals(((BloomFilter) obj).mask);
  4. }

代码示例来源:origin: Sable/soot

  1. @Override
  2. public boolean equals(Object obj) {
  3. if (!(obj instanceof ArrayTypesInternal)) {
  4. return false;
  5. }
  6. ArrayTypesInternal otherTypes = (ArrayTypesInternal) obj;
  7. return otherTypes.sizeState.equals(sizeState) && Arrays.equals(typeState, otherTypes.typeState)
  8. && mustAssign.equals(otherTypes.mustAssign);
  9. }
  10. }

代码示例来源:origin: PipelineAI/pipeline

  1. @Override
  2. public boolean equals(Object o) {
  3. if (this == o) return true;
  4. if (o == null || getClass() != o.getClass()) return false;
  5. EventCounts that = (EventCounts) o;
  6. if (numEmissions != that.numEmissions) return false;
  7. if (numFallbackEmissions != that.numFallbackEmissions) return false;
  8. if (numCollapsed != that.numCollapsed) return false;
  9. return events.equals(that.events);
  10. }

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

  1. @Override
  2. public boolean equals(Object o) {
  3. if (o == null) {
  4. return false;
  5. }
  6. if (o.getClass() != this.getClass()) {
  7. return false;
  8. }
  9. ExceptionSet other = (ExceptionSet) o;
  10. return exceptionSet.equals(other.exceptionSet) && explicitSet.equals(other.explicitSet)
  11. && universalHandler == other.universalHandler;
  12. }

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

  1. /**
  2. * Return whether or not this dataflow fact is identical to the one given.
  3. *
  4. * @param otherFact
  5. * another dataflow fact
  6. * @return true if the other dataflow fact is identical to this one, false
  7. * otherwise
  8. */
  9. public boolean isSameAs(UnconditionalValueDerefSet otherFact) {
  10. return valueNumbersUnconditionallyDereferenced.equals(otherFact.valueNumbersUnconditionallyDereferenced)
  11. && derefLocationSetMap.equals(otherFact.derefLocationSetMap);
  12. }

代码示例来源:origin: Sable/soot

  1. @Override
  2. public boolean equals(Object obj) {
  3. if (!(obj instanceof ArrayState)) {
  4. return false;
  5. }
  6. ArrayState otherState = (ArrayState) obj;
  7. return otherState.active.equals(active) && Arrays.equals(state, otherState.state);
  8. }

代码示例来源:origin: apache/ignite

  1. /** {@inheritDoc} */
  2. @Override public boolean equals(Object o) {
  3. if (this == o)
  4. return true;
  5. if (o == null || getClass() != o.getClass())
  6. return false;
  7. GridPartitionStateMap map = (GridPartitionStateMap)o;
  8. return size == map.size && states.equals(map.states);
  9. }

代码示例来源:origin: apache/kylin

  1. @Override
  2. public boolean equals(Object obj) {
  3. if (this == obj)
  4. return true;
  5. if (obj == null)
  6. return false;
  7. if (getClass() != obj.getClass())
  8. return false;
  9. ImmutableBitSet other = (ImmutableBitSet) obj;
  10. return this.set.equals(other.set);
  11. }

代码示例来源:origin: osmandapp/Osmand

  1. private boolean checkAllTypesShouldBePresent(BitSet types) {
  2. // Bitset method subset is missing "filterTypes.isSubset(types)"
  3. // reset previous evaluation
  4. // evalFilterTypes.clear(); // not needed same as or()
  5. evalFilterTypes.or(filterTypes);
  6. // evaluate bit intersection and check if filterTypes contained as set in types
  7. evalFilterTypes.and(types);
  8. if(!evalFilterTypes.equals(filterTypes)) {
  9. return false;
  10. }
  11. return true;
  12. }

代码示例来源:origin: looly/hutool

  1. @Override
  2. public boolean equals(final Object object) {
  3. if (this == object) {
  4. return true;
  5. }
  6. if (null == object) {
  7. return false;
  8. }
  9. if (object.getClass().equals(this.getClass())) {
  10. final ComparatorChain<?> otherChain = (ComparatorChain<?>) object;
  11. return (null == orderingBits ? null == otherChain.orderingBits : this.orderingBits.equals(otherChain.orderingBits)) //
  12. && (null == otherChain ? null == otherChain.chain : this.chain.equals(otherChain.chain));
  13. }
  14. return false;
  15. }

代码示例来源:origin: looly/hutool

  1. @Override
  2. public boolean equals(final Object object) {
  3. if (this == object) {
  4. return true;
  5. }
  6. if (null == object) {
  7. return false;
  8. }
  9. if (object.getClass().equals(this.getClass())) {
  10. final ComparatorChain<?> otherChain = (ComparatorChain<?>) object;
  11. return (null == orderingBits ? null == otherChain.orderingBits : this.orderingBits.equals(otherChain.orderingBits)) //
  12. && (null == otherChain ? null == otherChain.chain : this.chain.equals(otherChain.chain));
  13. }
  14. return false;
  15. }

代码示例来源:origin: ethereum/ethereumj

  1. public boolean hasTopic(Topic topic) {
  2. BitSet m = new BloomFilter(topic).mask;
  3. BitSet m1 = (BitSet) m.clone();
  4. m1.and(mask);
  5. return m1.equals(m);
  6. }

代码示例来源:origin: apache/kylin

  1. @Override
  2. public boolean equals(Object o) {
  3. if (this == o)
  4. return true;
  5. if (o == null || getClass() != o.getClass())
  6. return false;
  7. BitsChromosome that = (BitsChromosome) o;
  8. if (helper != null ? !helper.equals(that.helper) : that.helper != null)
  9. return false;
  10. return representation != null ? representation.equals(that.representation) : that.representation == null;
  11. }

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

  1. @Override
  2. public boolean equals(Object other) {
  3. if (! (other instanceof Validity)) return false;
  4. Validity v = (Validity) other;
  5. return validity.equals(v.validity) && zoneId.equals(v.zoneId) && start.equals(v.start);
  6. }

代码示例来源:origin: OryxProject/oryx

  1. @Override
  2. public boolean equals(Object o) {
  3. if (!(o instanceof CategoricalDecision)) {
  4. return false;
  5. }
  6. CategoricalDecision other = (CategoricalDecision) o;
  7. return getFeatureNumber() == other.getFeatureNumber() &&
  8. activeCategoryEncodings.equals(other.activeCategoryEncodings);
  9. }

代码示例来源:origin: skylot/jadx

  1. if (!prevIn.equals(newIn)) {
  2. changed = true;
  3. liveIn[blockId] = newIn;

代码示例来源:origin: skylot/jadx

  1. private static IfInfo checkForTernaryInCondition(IfInfo currentIf) {
  2. IfInfo nextThen = getNextIf(currentIf, currentIf.getThenBlock());
  3. IfInfo nextElse = getNextIf(currentIf, currentIf.getElseBlock());
  4. if (nextThen == null || nextElse == null) {
  5. return null;
  6. }
  7. if (!nextThen.getIfBlock().getDomFrontier().equals(nextElse.getIfBlock().getDomFrontier())) {
  8. return null;
  9. }
  10. nextThen = searchNestedIf(nextThen);
  11. nextElse = searchNestedIf(nextElse);
  12. if (nextThen.getThenBlock() == nextElse.getThenBlock()
  13. && nextThen.getElseBlock() == nextElse.getElseBlock()) {
  14. return mergeTernaryConditions(currentIf, nextThen, nextElse);
  15. }
  16. if (nextThen.getThenBlock() == nextElse.getElseBlock()
  17. && nextThen.getElseBlock() == nextElse.getThenBlock()) {
  18. nextElse = IfInfo.invert(nextElse);
  19. return mergeTernaryConditions(currentIf, nextThen, nextElse);
  20. }
  21. return null;
  22. }

相关文章