package edu.ucsb.cs.jicos.examples.fastfibonacci; import edu.ucsb.cs.jicos.services.*; /** * * @author Peter Cappello * @version 1 */ final class Atom extends Task { private int n; Atom( int n ) { this.n = n; } public Object execute( Environment environment ) { return new Integer( f(n) ); } public boolean isAtomic( Environment environment ) { return true; } private int f( int n ) { return ( n < 2 ) ? 1 : f( n - 1 ) + f( n - 2 ); } }