JACK 5.4 Application Interface

aos.jack.util.cursor
Class Again

java.lang.Object
  extended byaos.jack.jak.util.Watchable
      extended byaos.jack.jak.cursor.Cursor
          extended byaos.jack.util.cursor.Again
All Implemented Interfaces:
ObservableInt, TimerClient

public class Again
extends Cursor
implements TimerClient

The Again cursor is a cursor which returns true at regular time intervals.


Field Summary
 
Fields inherited from class aos.jack.jak.cursor.Cursor
FALSE, falseCursor, TRUE, trueCursor, UNKNOWN
 
Constructor Summary
Again(long r)
          Constructs an Again cursor with the specified interval, and using the default timer.
Again(long r, Agent a)
          Constructs an Again cursor with the specified interval, and using the passed in agent's timer.
Again(long r, FSM f)
           
Again(long r, Timer t)
          Creates an Again cursor with the specified interval and Timer.
 
Method Summary
 void expired(TimerHandle h, java.lang.Object o)
           
 void finished()
          This informs the cursor that it is not going to be used again.
 boolean isTriggered()
          Returns true.
 boolean next()
          Method to test if the next interval has been reached on the clock.
 void register(java.util.Observer o)
           
protected  void reschedule()
           
 Cursor reset(aos.jack.jak.core.Generator g, int index)
          Used to reinitialise the cursor.
 boolean unRegister(java.util.Observer o)
           
 
Methods inherited from class aos.jack.jak.cursor.Cursor
negate, undo
 
Methods inherited from class aos.jack.jak.util.Watchable
addObserver, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Again

public Again(long r,
             Timer t)
Creates an Again cursor with the specified interval and Timer.

Parameters:
r - The interval between successive triggerings of the cursor.
t - The timer used to measure the time.

Again

public Again(long r)
Constructs an Again cursor with the specified interval, and using the default timer.

Parameters:
r - The interval between successive triggerings of the cursor.

Again

public Again(long r,
             Agent a)
Constructs an Again cursor with the specified interval, and using the passed in agent's timer.

Parameters:
r - The interval between successive triggerings of the cursor.
a - The agent which contains the timer to use.

Again

public Again(long r,
             FSM f)
Method Detail

reschedule

protected void reschedule()

next

public boolean next()
Method to test if the next interval has been reached on the clock.

Specified by:
next in class Cursor
Returns:
true if the next interval has been reached, otherwise false.

reset

public Cursor reset(aos.jack.jak.core.Generator g,
                    int index)
Used to reinitialise the cursor.

Overrides:
reset in class Cursor
Parameters:
g - The generator that generates an equivalent cursor
index - The index of the equivalent cursor in the generator.
Returns:
The reset cursor, or an equivalent one.

finished

public void finished()
Description copied from class: Cursor
This informs the cursor that it is not going to be used again. This is typically used to clean up data strutures and to remove itself from any notification paths.

Overrides:
finished in class Cursor

isTriggered

public boolean isTriggered()
Returns true.

Overrides:
isTriggered in class Cursor

register

public void register(java.util.Observer o)
Overrides:
register in class Cursor

unRegister

public boolean unRegister(java.util.Observer o)
Overrides:
unRegister in class Cursor

expired

public void expired(TimerHandle h,
                    java.lang.Object o)
Specified by:
expired in interface TimerClient

JACK 5.4 Application Interface

Copyright (C) 1999-2008, Agent Oriented Software Pty. Ltd.

US Government Restricted Rights
The JACK Modules and relevant Software Material have been developed entirely at private expense and are accordingly provided with RESTRICTED RIGHTS. Use, duplication, or disclosure by Government is subject to restrictions as set forth in subparagraph (c)(1)(ii) of DFARS 252.227-7013 or subparagraph (c)(1) and (2) of the Commercial Computer Software Restricted Rights and 48 CFR 52.2270-19, as applicable.


Agent Oriented Software Pty. Ltd.     http://www.aosgrp.com
PO Box 639, Carlton South, Victoria 3053, Australia
Phone: +61 3 9349 5055, Fax: +61 3 9349 5088