jeops.examples.factorial
Class Fact

java.lang.Object
  |
  +--jeops.examples.factorial.Fact

public class Fact
extends java.lang.Object

Class used to solve the factorial problem (N!) with JEOPS.

Author:
Carlos Figueira Filho (csff@di.ufpe.br)

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).
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Fact

public Fact(int n)
Class constructor.
Parameters:
n - the number whose factorial we are trying to find.
Method Detail

getN

public int getN()
Returns the number whose factorial we are trying to find.
Returns:
the number whose factorial we are trying to find.

isOk

public boolean isOk()
Checks whether this problem is already solved.
Returns:
true if this problem is already solved; false otherwise.

getResult

public int getResult()
Returns the factorial of n.
Returns:
the factorial of n.

setResult

public void setResult(int value)
Defines the factorial of n.
Parameters:
value - the factorial of n.

getSubProblem

public Fact getSubProblem()
Returns the factorial of (n - 1).
Returns:
the factorial of (n - 1).

setSubProblem

public void setSubProblem(Fact value)
Defines the factorial of (n - 1).
Parameters:
value - the factorial of (n - 1).