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

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

本文整理了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,

((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,

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

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

代码示例

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

@Override
public boolean equals(Object other) {
  if (this == other) {
    return true;
  }
  if (!(other instanceof CronSequenceGenerator)) {
    return false;
  }
  CronSequenceGenerator otherCron = (CronSequenceGenerator) other;
  return (this.months.equals(otherCron.months) && this.daysOfMonth.equals(otherCron.daysOfMonth) &&
      this.daysOfWeek.equals(otherCron.daysOfWeek) && this.hours.equals(otherCron.hours) &&
      this.minutes.equals(otherCron.minutes) && this.seconds.equals(otherCron.seconds));
}

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

@Override
public boolean equals(Object other) {
  if (this == other) {
    return true;
  }
  if (!(other instanceof CronSequenceGenerator)) {
    return false;
  }
  CronSequenceGenerator otherCron = (CronSequenceGenerator) other;
  return (this.months.equals(otherCron.months) && this.daysOfMonth.equals(otherCron.daysOfMonth) &&
      this.daysOfWeek.equals(otherCron.daysOfWeek) && this.hours.equals(otherCron.hours) &&
      this.minutes.equals(otherCron.minutes) && this.seconds.equals(otherCron.seconds));
}

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

@Override
public boolean equals(Object other) {
  if (this == other) {
    return true;
  }
  if (!(other instanceof CronSequenceGenerator)) {
    return false;
  }
  CronSequenceGenerator otherCron = (CronSequenceGenerator) other;
  return (this.months.equals(otherCron.months) && this.daysOfMonth.equals(otherCron.daysOfMonth) &&
      this.daysOfWeek.equals(otherCron.daysOfWeek) && this.hours.equals(otherCron.hours) &&
      this.minutes.equals(otherCron.minutes) && this.seconds.equals(otherCron.seconds));
}

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

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

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

@Override
 public boolean equals(Object obj) {
  if (!(obj instanceof ArrayTypesInternal)) {
   return false;
  }
  ArrayTypesInternal otherTypes = (ArrayTypesInternal) obj;
  return otherTypes.sizeState.equals(sizeState) && Arrays.equals(typeState, otherTypes.typeState)
    && mustAssign.equals(otherTypes.mustAssign);
 }
}

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

@Override
public boolean equals(Object o) {
  if (this == o) return true;
  if (o == null || getClass() != o.getClass()) return false;
  EventCounts that = (EventCounts) o;
  if (numEmissions != that.numEmissions) return false;
  if (numFallbackEmissions != that.numFallbackEmissions) return false;
  if (numCollapsed != that.numCollapsed) return false;
  return events.equals(that.events);
}

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

@Override
public boolean equals(Object o) {
  if (o == null) {
    return false;
  }
  if (o.getClass() != this.getClass()) {
    return false;
  }
  ExceptionSet other = (ExceptionSet) o;
  return exceptionSet.equals(other.exceptionSet) && explicitSet.equals(other.explicitSet)
      && universalHandler == other.universalHandler;
}

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

/**
 * Return whether or not this dataflow fact is identical to the one given.
 *
 * @param otherFact
 *            another dataflow fact
 * @return true if the other dataflow fact is identical to this one, false
 *         otherwise
 */
public boolean isSameAs(UnconditionalValueDerefSet otherFact) {
  return valueNumbersUnconditionallyDereferenced.equals(otherFact.valueNumbersUnconditionallyDereferenced)
      && derefLocationSetMap.equals(otherFact.derefLocationSetMap);
}

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

@Override
public boolean equals(Object obj) {
 if (!(obj instanceof ArrayState)) {
  return false;
 }
 ArrayState otherState = (ArrayState) obj;
 return otherState.active.equals(active) && Arrays.equals(state, otherState.state);
}

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

/** {@inheritDoc} */
@Override public boolean equals(Object o) {
  if (this == o)
    return true;
  if (o == null || getClass() != o.getClass())
    return false;
  GridPartitionStateMap map = (GridPartitionStateMap)o;
  return size == map.size && states.equals(map.states);
}

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

@Override
public boolean equals(Object obj) {
  if (this == obj)
    return true;
  if (obj == null)
    return false;
  if (getClass() != obj.getClass())
    return false;
  ImmutableBitSet other = (ImmutableBitSet) obj;
  return this.set.equals(other.set);
}

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

private boolean checkAllTypesShouldBePresent(BitSet types) {
  // Bitset method subset is missing "filterTypes.isSubset(types)"    
  // reset previous evaluation
  // evalFilterTypes.clear(); // not needed same as or()
  evalFilterTypes.or(filterTypes);
  // evaluate bit intersection and check if filterTypes contained as set in types
  evalFilterTypes.and(types);
  if(!evalFilterTypes.equals(filterTypes)) {
    return false;
  }
  return true;
}

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

@Override
public boolean equals(final Object object) {
  if (this == object) {
    return true;
  }
  if (null == object) {
    return false;
  }
  if (object.getClass().equals(this.getClass())) {
    final ComparatorChain<?> otherChain = (ComparatorChain<?>) object;
    return (null == orderingBits ? null == otherChain.orderingBits : this.orderingBits.equals(otherChain.orderingBits)) //
        && (null == otherChain ? null == otherChain.chain : this.chain.equals(otherChain.chain));
  }
  return false;
}

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

@Override
public boolean equals(final Object object) {
  if (this == object) {
    return true;
  }
  if (null == object) {
    return false;
  }
  if (object.getClass().equals(this.getClass())) {
    final ComparatorChain<?> otherChain = (ComparatorChain<?>) object;
    return (null == orderingBits ? null == otherChain.orderingBits : this.orderingBits.equals(otherChain.orderingBits)) //
        && (null == otherChain ? null == otherChain.chain : this.chain.equals(otherChain.chain));
  }
  return false;
}

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

public boolean hasTopic(Topic topic) {
  BitSet m = new BloomFilter(topic).mask;
  BitSet m1 = (BitSet) m.clone();
  m1.and(mask);
  return m1.equals(m);
}

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

@Override
public boolean equals(Object o) {
  if (this == o)
    return true;
  if (o == null || getClass() != o.getClass())
    return false;
  BitsChromosome that = (BitsChromosome) o;
  if (helper != null ? !helper.equals(that.helper) : that.helper != null)
    return false;
  return representation != null ? representation.equals(that.representation) : that.representation == null;
}

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

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

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

@Override
public boolean equals(Object o) {
 if (!(o instanceof CategoricalDecision)) {
  return false;
 }
 CategoricalDecision other = (CategoricalDecision) o;
 return getFeatureNumber() == other.getFeatureNumber() &&
   activeCategoryEncodings.equals(other.activeCategoryEncodings);
}

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

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

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

private static IfInfo checkForTernaryInCondition(IfInfo currentIf) {
  IfInfo nextThen = getNextIf(currentIf, currentIf.getThenBlock());
  IfInfo nextElse = getNextIf(currentIf, currentIf.getElseBlock());
  if (nextThen == null || nextElse == null) {
    return null;
  }
  if (!nextThen.getIfBlock().getDomFrontier().equals(nextElse.getIfBlock().getDomFrontier())) {
    return null;
  }
  nextThen = searchNestedIf(nextThen);
  nextElse = searchNestedIf(nextElse);
  if (nextThen.getThenBlock() == nextElse.getThenBlock()
      && nextThen.getElseBlock() == nextElse.getElseBlock()) {
    return mergeTernaryConditions(currentIf, nextThen, nextElse);
  }
  if (nextThen.getThenBlock() == nextElse.getElseBlock()
      && nextThen.getElseBlock() == nextElse.getThenBlock()) {
    nextElse = IfInfo.invert(nextElse);
    return mergeTernaryConditions(currentIf, nextThen, nextElse);
  }
  return null;
}

相关文章