org.norther.tammi.manual.sample
Class FibonacciCounter

java.lang.Object
  extended by org.norther.tammi.manual.sample.FibonacciCounter
Direct Known Subclasses:
Counter, DynamicCounter

public class FibonacciCounter
extends Object

FibonacciCounter is an implementation of a simple Fibonacci counter. Note that this code is only instructional.


Constructor Summary
FibonacciCounter()
          Default constructor.
 
Method Summary
 int count()
          Counts the Fibonacci number specified by the preset counter.
 int getCounter()
          Gets the value of the counter.
 void setCounter(int counter)
          Sets the value of the counter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FibonacciCounter

public FibonacciCounter()
Default constructor.

Method Detail

getCounter

public int getCounter()
Gets the value of the counter.

Returns:
the counter.

setCounter

public void setCounter(int counter)
Sets the value of the counter.

Parameters:
counter - the counter.

count

public int count()
Counts the Fibonacci number specified by the preset counter.

Returns:
a Fibonacci number.


Copyright © 2004 The Norther Organization. All rights reserved.