sofia.micro.greenfoot
Class Greenfoot

java.lang.Object
  extended by sofia.micro.greenfoot.Greenfoot

public class Greenfoot
extends java.lang.Object

A small "adaptor" class that provides Greenfoot-style static methods for some Sofia features. It is intended to provide for source-level compatibility of some Greenfoot examples.

Version:
$Date: 2012/08/06 11:13 $
Author:
Stephen Edwards, Last changed by $Author: edwards $

Method Summary
static int getRandomNumber(int limit)
          Return a random number between 0 (inclusive) and limit (exclusive).
static void setSpeed(int speed)
          Set the speed of the execution.
static void start()
          Run (or resume) the execution.
static void stop()
          Pause the execution.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

setSpeed

public static void setSpeed(int speed)
Set the speed of the execution.

Parameters:
speed - The new speed. the value must be in the range (1..100)

stop

public static void stop()
Pause the execution.


start

public static void start()
Run (or resume) the execution.


getRandomNumber

public static int getRandomNumber(int limit)
Return a random number between 0 (inclusive) and limit (exclusive).

Parameters:
limit - The upper limit of the generated number--the generated number will be strictly less than this limit.
Returns:
A random number in the specified range.


Greenfoot homepage