interfaces
Interface ClockSpecification

All Superinterfaces:
HasInvariant
All Known Implementing Classes:
Clock

public interface ClockSpecification
extends HasInvariant

A clock used to count time increments
Tested by JUnit_ClockSpecification

Version:
1
Author:
J Paul Gibson

Method Summary
 int getTime()
          Tested by JUnit_ClockSpecification.test_getTime()
 boolean invariant()
          Tested by JUnit_ClockSpecification.test_invariant()
 void resetClock()
          Set the clock timer to 0
Tested by JUnit_ClockSpecification.test_resetClock()
 void setClock(int x)
          Set the clock to a specific value
Tested by tests.JUnit_ClockSpecification#test_setClock(int)
 void tick()
          Increment the clock by 1 unit
Tested by JUnit_ClockSpecification.test_tick()
 void tick(int x)
          Increment the clock
Tested by JUnit_ClockSpecification.test_tick_int()
 

Method Detail

getTime

int getTime()
Tested by JUnit_ClockSpecification.test_getTime()

Returns:
the time value representing a number of ticks

invariant

boolean invariant()
Tested by JUnit_ClockSpecification.test_invariant()

Specified by:
invariant in interface HasInvariant
Returns:
true iff the number of ticks is non-negative

resetClock

void resetClock()
Set the clock timer to 0
Tested by JUnit_ClockSpecification.test_resetClock()


setClock

void setClock(int x)
              throws java.lang.IllegalArgumentException
Set the clock to a specific value
Tested by tests.JUnit_ClockSpecification#test_setClock(int)

Parameters:
x -
Throws:
java.lang.IllegalArgumentException - when x is negative

tick

void tick()
Increment the clock by 1 unit
Tested by JUnit_ClockSpecification.test_tick()


tick

void tick(int x)
          throws java.lang.IllegalArgumentException
Increment the clock
Tested by JUnit_ClockSpecification.test_tick_int()

Parameters:
x - is the number of time units by which the clock should be incremented
Throws:
java.lang.IllegalArgumentException - when x is negative