java.util.concurrent.atomic.AtomicInteger.doubleValue()方法的使用及代码示例

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

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

AtomicInteger.doubleValue介绍

[英]Returns the value of this AtomicInteger as a doubleafter a widening primitive conversion.
[中]在扩大原语转换后,以Double形式返回此AtomicInteger的值。

代码示例

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

readWriteTest.run(numRequests, numThreads);
System.out.println("Random Access Read Only store Results:");
System.out.println("Null reads ratio:" + (nullResults.doubleValue())
          / totalResults.doubleValue());
readWriteTest.printStats();
System.exit(0);

代码示例来源:origin: apache/activemq-artemis

public void close() throws IOException {
  if(closed.compareAndSet(false, true)) {
    if(stats)
      avg_state_size=num_bytes_sent.addAndGet(bytesWrittenCounter) / num_state_reqs.doubleValue();
  }
}

代码示例来源:origin: apache/activemq-artemis

public void close() throws IOException {
  if(closed.compareAndSet(false, true)) {
    if(stats)
      avg_state_size=num_bytes_sent.addAndGet(bytesWrittenCounter) / num_state_reqs.doubleValue();
  }
}

代码示例来源:origin: org.apache.activemq/artemis-jms-client-all

public void close() throws IOException {
  if(closed.compareAndSet(false, true)) {
    if(stats)
      avg_state_size=num_bytes_sent.addAndGet(bytesWrittenCounter) / num_state_reqs.doubleValue();
  }
}

代码示例来源:origin: jMotif/sax-vsm_classic

/**
 * Get the words collection along with frequencies.
 * 
 * @return The map of words as keys with frequencies as values.
 */
public synchronized HashMap<String, Double> getWordsAsDoubles() {
 HashMap<String, Double> res = new HashMap<String, Double>();
 for (Entry<String, AtomicInteger> e : this.words.entrySet()) {
  res.put(e.getKey(), e.getValue().doubleValue());
 }
 return res;
}

代码示例来源:origin: org.databene/databene-commons

public boolean equalDistribution(double tolerance) {
  double average = averageCount();
  Collection<AtomicInteger> counts = instances.values();
  for (AtomicInteger count : counts) {
    if (Math.abs((count.doubleValue() - average) / average) > tolerance)
      return false;
  }
  return true;
}

代码示例来源:origin: pl.allegro.tech.hermes/hermes-consumers

public void reset() {
  failures.set(0);
  successes.set(0);
  long now = clock.millis();
  long elapsedSeconds = TimeUnit.MILLISECONDS.toSeconds(now - lastReset);
  rate.set(attempted.doubleValue() / Math.max(elapsedSeconds, 1));
  attempted.set(0);
  lastReset = now;
}

代码示例来源:origin: allegro/hermes

public void reset() {
  failures.set(0);
  successes.set(0);
  long now = clock.millis();
  long elapsedSeconds = TimeUnit.MILLISECONDS.toSeconds(now - lastReset);
  rate.set(attempted.doubleValue() / Math.max(elapsedSeconds, 1));
  attempted.set(0);
  lastReset = now;
}

代码示例来源:origin: io.sarl.lang/io.sarl.lang.core

/** The binary {@code lessEqualsThan} operator. This is the equivalent
 * to the Java {@code &lt;=} operator. This function is not null-safe.
 *
 * @param left a number.
 * @param right a number.
 * @return {@code left&lt;=right}
 */
@Pure
@Inline(value = "($1.doubleValue() <= $2.doubleValue())", constantExpression = true)
public static boolean operator_lessEqualsThan(AtomicInteger left, Number right) {
  return left.doubleValue() <= right.doubleValue();
}

代码示例来源:origin: io.sarl.lang/io.sarl.lang.core

/** The binary {@code greaterThan} operator. This is the equivalent
 * to the Java {@code &gt;} operator. This function is not null-safe.
 *
 * @param left a number.
 * @param right a number.
 * @return {@code left&gt;right}
 */
@Pure
@Inline(value = "($1.doubleValue() > $2.doubleValue())", constantExpression = true)
public static boolean operator_greaterThan(AtomicInteger left, Number right) {
  return left.doubleValue() > right.doubleValue();
}

代码示例来源:origin: io.sarl.lang/io.sarl.lang.core

/** The binary {@code greaterEqualsThan} operator. This is the equivalent
 * to the Java {@code &gt;=} operator. This function is not null-safe.
 *
 * @param left a number.
 * @param right a number.
 * @return {@code left&gt;=right}
 */
@Pure
@Inline(value = "($1.doubleValue() >= $2.doubleValue())", constantExpression = true)
public static boolean operator_greaterEqualsThan(AtomicInteger left, Number right) {
  return left.doubleValue() >= right.doubleValue();
}

代码示例来源:origin: io.sarl.lang/io.sarl.lang.core

/** The binary {@code lessThan} operator. This is the equivalent to
 * the Java {@code &lt;} operator. This function is not null-safe.
 *
 * @param left a number.
 * @param right a number.
 * @return {@code left&lt;right}
 */
@Pure
@Inline(value = "($1.doubleValue() < $2.doubleValue())", constantExpression = true)
public static boolean operator_lessThan(AtomicInteger left, Number right) {
  return left.doubleValue() < right.doubleValue();
}

代码示例来源:origin: io.sarl.lang/io.sarl.lang.core

/** The binary {@code notEquals} operator. This is the equivalent
 * to the Java {@code !=} operator. This function is null-safe.
 *
 * @param left a number.
 * @param right a number.
 * @return {@code left!=right}
 */
@Pure
@Inline(value = "($1 == null ? ($2 != null) : ($2 == null || $1.doubleValue() != $2.doubleValue()))", constantExpression = true)
public static boolean operator_notEquals(AtomicInteger left, Number right) {
  return left == null ? right != null : right == null || left.doubleValue() != right.doubleValue();
}

代码示例来源:origin: io.sarl.lang/io.sarl.lang.core

/** Convert the given value to {@code double}. This function is not null-safe.
 *
 * @param number a number of {@code AtomicInteger} type.
 * @return the equivalent value to {@code number} of {@code double} type.
 */
@Pure
@Inline(value = "$1.doubleValue()")
public static double toDouble(AtomicInteger number) {
  return number.doubleValue();
}

代码示例来源:origin: io.sarl.lang/io.sarl.lang.core

/** The binary {@code greaterEqualsThan} operator. This is the equivalent
 * to the Java {@code &gt;=} operator. This function is not null-safe.
 *
 * @param left a number.
 * @param right a number.
 * @return {@code left&gt;=right}
 */
@Pure
@Inline(value = "($1.doubleValue() >= $2)", constantExpression = true)
public static boolean operator_greaterEqualsThan(AtomicInteger left, double right) {
  return left.doubleValue() >= right;
}

代码示例来源:origin: io.sarl.lang/io.sarl.lang.core

/** The binary {@code notEquals} operator. This is the equivalent
 * to the Java {@code !=} operator. This function is null-safe.
 *
 * @param left a number.
 * @param right a number.
 * @return {@code left!=right}
 */
@Pure
@Inline(value = "($1 == null ? false : ($1.doubleValue() != $2))", constantExpression = true)
public static boolean operator_notEquals(AtomicInteger left, double right) {
  return left == null ? false : left.doubleValue() != right;
}

代码示例来源:origin: io.sarl.lang/io.sarl.lang.core

/** The binary {@code greaterThan} operator. This is the equivalent
 * to the Java {@code &gt;} operator. This function is not null-safe.
 *
 * @param left a number.
 * @param right a number.
 * @return {@code left&gt;right}
 */
@Pure
@Inline(value = "($1.doubleValue() > $2)", constantExpression = true)
public static boolean operator_greaterThan(AtomicInteger left, double right) {
  return left.doubleValue() > right;
}

代码示例来源:origin: io.sarl.lang/io.sarl.lang.core

/** The binary {@code lessThan} operator. This is the equivalent to
 * the Java {@code &lt;} operator. This function is not null-safe.
 *
 * @param left a number.
 * @param right a number.
 * @return {@code left&lt;right}
 */
@Pure
@Inline(value = "($1.doubleValue() < $2)", constantExpression = true)
public static boolean operator_lessThan(AtomicInteger left, double right) {
  return left.doubleValue() < right;
}

代码示例来源:origin: io.sarl.lang/io.sarl.lang.core

/** The binary {@code lessEqualsThan} operator. This is the equivalent
 * to the Java {@code &lt;=} operator. This function is not null-safe.
 *
 * @param left a number.
 * @param right a number.
 * @return {@code left&lt;=right}
 */
@Pure
@Inline(value = "($1.doubleValue() <= $2)", constantExpression = true)
public static boolean operator_lessEqualsThan(AtomicInteger left, double right) {
  return left.doubleValue() <= right;
}

代码示例来源:origin: apache/activemq-artemis

protected void getStateFromApplication(Address requester, Digest digest) {
  StateTransferInfo rsp=(StateTransferInfo)up_prot.up(new Event(Event.GET_APPLSTATE));
  byte[] state=rsp.state;
  if(stats) {
    num_state_reqs.incrementAndGet();
    if(state != null)
      num_bytes_sent.addAndGet(state.length);
    avg_state_size=num_bytes_sent.doubleValue() / num_state_reqs.doubleValue();
  }
  Message state_rsp=new Message(requester, state).putHeader(this.id, new StateHeader(StateHeader.STATE_RSP, digest));
  log.trace("%s: sending state to %s (size=%s)", local_addr, state_rsp.getDest(), Util.printBytes(state != null? state.length : 0));
  down_prot.down(new Event(Event.MSG,state_rsp));
}

相关文章