|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectprovided.client.model.task.Pi2
public class Pi2
Task to compute PI to a given number of digits
| Field Summary | |
|---|---|
private int |
digits
digits of precision after the decimal point |
private static java.math.BigDecimal |
FOUR
constants used in pi computation |
private static int |
roundingMode
rounding mode to use during pi computation |
private static long |
serialVersionUID
SerialversionUID for well-defined serialization. |
private ILocalTaskViewAdapter |
taskView
Adapter to the local view. |
| Constructor Summary | |
|---|---|
Pi2(int digits)
Construct a task to calculate pi to the specified precision. |
|
| Method Summary | |
|---|---|
private java.math.BigDecimal |
arctan(int inverseX,
int scale)
Compute the value, in radians, of the arctangent of the inverse of the supplied integer to the specified number of digits after the decimal point. |
private java.math.BigDecimal |
computePi(int digits)
Compute the value of pi to the specified number of digits after the decimal point. |
java.math.BigDecimal |
execute()
Calculate pi. |
private void |
readObject(java.io.ObjectInputStream stream)
Reinitializes transient fields upon deserialization. |
void |
setTaskViewAdapter(ILocalTaskViewAdapter viewAdapter)
Sets the task view adapter to a new value. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static final long serialVersionUID
private transient ILocalTaskViewAdapter taskView
private static final java.math.BigDecimal FOUR
private static final int roundingMode
private final int digits
| Constructor Detail |
|---|
public Pi2(int digits)
digits - the number of digits to calculate PI to| Method Detail |
|---|
public java.math.BigDecimal execute()
execute in interface ITask<java.math.BigDecimal>private java.math.BigDecimal computePi(int digits)
private java.math.BigDecimal arctan(int inverseX,
int scale)
private void readObject(java.io.ObjectInputStream stream)
throws java.io.IOException,
java.lang.ClassNotFoundException
stream - The object stream with the serialized data
java.io.IOException
java.lang.ClassNotFoundExceptionpublic void setTaskViewAdapter(ILocalTaskViewAdapter viewAdapter)
setTaskViewAdapter in interface ITask<java.math.BigDecimal>viewAdapter - an adapter to the view.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||