p_models
Class RunnableViewablePaddle

java.lang.Object
  extended by p_models.Paddle
      extended by p_models.RunnableViewablePaddle
All Implemented Interfaces:
java.lang.Runnable, PaddleSpecification, HasInvariant

public class RunnableViewablePaddle
extends Paddle
implements java.lang.Runnable

Implements Runnable

Extends Paddle with link back to the view and a run method

For teaching MVC design pattern.

Version:
1.0.0
Author:
J Paul Gibson

Field Summary
static int DELAY
          A 1/10th second delay between movements of Paddle
 
Fields inherited from interface p_abstractions.PaddleSpecification
INVARIANT_OF_CLASS, MAXIMUM_position, MINIMUM_position
 
Constructor Summary
RunnableViewablePaddle()
           
 
Method Summary
 void run()
          Every 10th of second: update the paddle position inform the view (if it has been initialised) of the update
 void setView(PaddleViewSpecification paddleView2)
           
 
Methods inherited from class p_models.Paddle
changeDirection, equals, get_position, goingRight, invariant, toString, updatePosition
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DELAY

public static final int DELAY
A 1/10th second delay between movements of Paddle

See Also:
Constant Field Values
Constructor Detail

RunnableViewablePaddle

public RunnableViewablePaddle()
Method Detail

setView

public void setView(PaddleViewSpecification paddleView2)
Parameters:
paddleView2 - the current view which responds to state changes

run

public void run()
Every 10th of second:

Specified by:
run in interface java.lang.Runnable