|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--jeops.examples.factorial.Fact
Class used to solve the factorial problem (N!) with JEOPS.
Field Summary | |
private int |
n
The number whose factorial we are trying to find. |
private boolean |
ok
Flag indicating whether this problem is already solved. |
private int |
result
The factorial of n. |
private Fact |
subProblem
The factorial of (n - 1). |
Constructor Summary | |
Fact(int n)
Class constructor. |
Method Summary | |
int |
getN()
Returns the number whose factorial we are trying to find. |
int |
getResult()
Returns the factorial of n. |
Fact |
getSubProblem()
Returns the factorial of (n - 1). |
boolean |
isOk()
Checks whether this problem is already solved. |
void |
setResult(int value)
Defines the factorial of n. |
void |
setSubProblem(Fact value)
Defines the factorial of (n - 1). |
java.lang.String |
toString()
Returns a String representation of this problem. |
Methods inherited from class java.lang.Object |
|
Field Detail |
private int n
private boolean ok
private int result
private Fact subProblem
Constructor Detail |
public Fact(int n)
n
- the number whose factorial we are trying to find.Method Detail |
public int getN()
public int getResult()
public Fact getSubProblem()
public boolean isOk()
true
if this problem is already solved;
false
otherwise.public void setResult(int value)
value
- the factorial of n.public void setSubProblem(Fact value)
value
- the factorial of (n - 1).public java.lang.String toString()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |