Java Code Examples for java.util.concurrent.atomic.AtomicInteger#longValue()

The following examples show how to use java.util.concurrent.atomic.AtomicInteger#longValue() . These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
public double computeProgress() {
    if (progress.length == 0) {
        return (double)1;
    }
    long result = 0;
    for (AtomicInteger pct : progress) {
        result += pct.longValue();
    }
    return (double)result / progress.length / 100;
}
 
Example 2
public void publishMetricEvent(MetricType metricType, AtomicInteger atomicTimeoutGauge) {
  final long gaugeValue = (atomicTimeoutGauge == null) ? -1 : atomicTimeoutGauge.longValue();
  MetricEvent metricEvent = new MetricEvent(this, metricType, gaugeValue, null);
  publisher.publishEvent(metricEvent);
}
 
Example 3
/** Convert the given value to {@code AtomicLong}. This function is not null-safe.
 *
 * @param number a number of {@code AtomicInteger} type.
 * @return the equivalent value to {@code number} of {@code AtomicLong} type.
 */
@Pure
@Inline(value = "new $2($1.longValue())", imported = AtomicLong.class)
public static AtomicLong toAtomicLong(AtomicInteger number) {
	return new AtomicLong(number.longValue());
}
 
Example 4
/** The binary {@code greaterEqualsThan} operator. This is the equivalent
 * to the Java {@code >=} operator. This function is not null-safe.
 *
 * @param left a number.
 * @param right a number.
 * @return {@code left>=right}
 */
@Pure
@Inline(value = "($1.longValue() >= $2)", constantExpression = true)
public static boolean operator_greaterEqualsThan(AtomicInteger left, long right) {
	return left.longValue() >= right;
}
 
Example 5
/** The binary {@code lessEqualsThan} operator. This is the equivalent
 * to the Java {@code <=} operator. This function is not null-safe.
 *
 * @param left a number.
 * @param right a number.
 * @return {@code left<=right}
 */
@Pure
@Inline(value = "($1.longValue() <= $2)", constantExpression = true)
public static boolean operator_lessEqualsThan(AtomicInteger left, long right) {
	return left.longValue() <= right;
}
 
Example 6
/** 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.longValue() > $2)", constantExpression = true)
public static boolean operator_greaterThan(AtomicInteger left, long right) {
	return left.longValue() > right;
}
 
Example 7
/** 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.longValue() < $2)", constantExpression = true)
public static boolean operator_lessThan(AtomicInteger left, long right) {
	return left.longValue() < right;
}
 
Example 8
/**
 * The binary {@code equals} 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 ? ($1.longValue() == $2) : false)", constantExpression = true)
public static boolean operator_equals(AtomicInteger left, long right) {
	return left != null ? left.longValue() == right : false;
}
 
Example 9
/** The binary {@code multiply} operator. This is the equivalent to
 * the Java {@code *} operator. This function is not null-safe.
 *
 * @param left a number.
 * @param right a number.
 * @return {@code left*right}
 */
@Pure
@Inline(value = "($1.intValue() * $2.longValue())", constantExpression = true)
public static long operator_multiply(AtomicInteger left, AtomicLong right) {
	return left.longValue() * right.longValue();
}
 
Example 10
/** The binary {@code minus} operator. This is the equivalent to
 * the Java {@code -} operator. This function is not null-safe.
 *
 * @param left a number.
 * @param right a number.
 * @return {@code left-right}
 */
@Pure
@Inline(value = "($1.intValue() - $2)", constantExpression = true)
public static long operator_minus(AtomicInteger left, long right) {
	return left.longValue() - right;
}
 
Example 11
/** The binary {@code minus} operator. This is the equivalent to
 * the Java {@code -} operator. This function is not null-safe.
 *
 * @param left a number.
 * @param right a number.
 * @return {@code left-right}
 */
@Pure
@Inline(value = "($1.intValue() - $2.longValue())", constantExpression = true)
public static long operator_minus(AtomicInteger left, Long right) {
	return left.longValue() - right.longValue();
}
 
Example 12
/** The binary {@code modulo} operator. This is the equivalent to
 * the Java {@code %} operator. This function is not null-safe.
 *
 * @param left a number.
 * @param right a number.
 * @return {@code left%right}
 */
@Pure
@Inline(value = "($1.intValue() % $2.longValue())", constantExpression = true)
public static long operator_modulo(AtomicInteger left, Long right) {
	return left.longValue() % right.longValue();
}
 
Example 13
/** The binary {@code modulo} operator. This is the equivalent to
 * the Java {@code %} operator. This function is not null-safe.
 *
 * @param left a number.
 * @param right a number.
 * @return {@code left%right}
 */
@Pure
@Inline(value = "($1.intValue() % $2)", constantExpression = true)
public static long operator_modulo(AtomicInteger left, long right) {
	return left.longValue() % right;
}
 
Example 14
/** The binary {@code plus} operator. This is the equivalent to
 * the Java {@code +} operator. This function is not null-safe.
 *
 * @param left a number.
 * @param right a number.
 * @return {@code left+right}
 */
@Pure
@Inline(value = "($1.intValue() + $2.longValue())", constantExpression = true)
public static long operator_plus(AtomicInteger left, Long right) {
	return left.longValue() + right.longValue();
}
 
Example 15
/** The binary {@code plus} operator. This is the equivalent to
 * the Java {@code +} operator. This function is not null-safe.
 *
 * @param left a number.
 * @param right a number.
 * @return {@code left+right}
 */
@Pure
@Inline(value = "($1.intValue() + $2.longValue())", constantExpression = true)
public static long operator_plus(AtomicInteger left, AtomicLong right) {
	return left.longValue() + right.longValue();
}
 
Example 16
/** The binary {@code divide} operator. This is the equivalent to
 * the Java {@code /} operator. This function is not null-safe.
 *
 * @param left a number.
 * @param right a number.
 * @return {@code left/right}
 */
@Pure
@Inline(value = "($1.intValue() / $2)", constantExpression = true)
public static long operator_divide(AtomicInteger left, long right) {
	return left.longValue() / right;
}
 
Example 17
/** The binary {@code divide} operator. This is the equivalent to
 * the Java {@code /} operator. This function is not null-safe.
 *
 * @param left a number.
 * @param right a number.
 * @return {@code left/right}
 */
@Pure
@Inline(value = "($1.intValue() / $2.longValue())", constantExpression = true)
public static long operator_divide(AtomicInteger left, Long right) {
	return left.longValue() / right.longValue();
}
 
Example 18
/** The binary {@code divide} operator. This is the equivalent to
 * the Java {@code /} operator. This function is not null-safe.
 *
 * @param left a number.
 * @param right a number.
 * @return {@code left/right}
 */
@Pure
@Inline(value = "($1.intValue() / $2.longValue())", constantExpression = true)
public static long operator_divide(AtomicInteger left, AtomicLong right) {
	return left.longValue() / right.longValue();
}
 
Example 19
/** The binary {@code multiply} operator. This is the equivalent to
 * the Java {@code *} operator. This function is not null-safe.
 *
 * @param left a number.
 * @param right a number.
 * @return {@code left*right}
 */
@Pure
@Inline(value = "($1.intValue() * $2)", constantExpression = true)
public static long operator_multiply(AtomicInteger left, long right) {
	return left.longValue() * right;
}
 
Example 20
/** The binary {@code multiply} operator. This is the equivalent to
 * the Java {@code *} operator. This function is not null-safe.
 *
 * @param left a number.
 * @param right a number.
 * @return {@code left*right}
 */
@Pure
@Inline(value = "($1.intValue() * $2.longValue())", constantExpression = true)
public static long operator_multiply(AtomicInteger left, Long right) {
	return left.longValue() * right.longValue();
}