Package org.apfloat.samples
Class Pi.BinarySplittingProgressIndicator
- java.lang.Object
-
- org.apfloat.samples.Pi.BinarySplittingProgressIndicator
-
- All Implemented Interfaces:
java.io.Serializable
- Enclosing class:
- Pi
public static class Pi.BinarySplittingProgressIndicator extends java.lang.Object implements java.io.Serializable
Indicates progress of the pi calculation using the binary splitting algorithm.This implementation is thread safe for multiple threads to use concurrently.
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.concurrent.atomic.AtomicLong
currentElements
private static long
PROGRESS_RECURSION_THRESHOLD
private static long
serialVersionUID
private long
totalElements
-
Constructor Summary
Constructors Constructor Description BinarySplittingProgressIndicator(long terms)
Construct a progress indicator with the specified number of terms of the series.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
progress(long n1, long n2)
Advances the progress.private long
recursiveLength(long length)
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
PROGRESS_RECURSION_THRESHOLD
private static final long PROGRESS_RECURSION_THRESHOLD
- See Also:
- Constant Field Values
-
totalElements
private long totalElements
-
currentElements
private java.util.concurrent.atomic.AtomicLong currentElements
-
-