JACK 5.4 Application Interface

aos.jack.jak.cursor
Class TimeCursor

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

public class TimeCursor
extends Cursor
implements TimerClient

Implements a cursor that triggers at a particular time.


Field Summary
 
Fields inherited from class aos.jack.jak.cursor.Cursor
FALSE, falseCursor, TRUE, trueCursor, UNKNOWN
 
Constructor Summary
TimeCursor(long at, Timer t)
          Construct a TimeCursor.
 
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()
          Used by JACK to determine if the cursor provides triggering.
 boolean next()
          Used to test if the Cursor is true.
 void register(java.util.Observer o)
           
 Cursor reset(aos.jack.jak.core.Generator g, int index)
          Resets the cursor so a call to next() will return if the correct time has passed.
 java.lang.String toString()
           
 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, wait, wait, wait
 

Constructor Detail

TimeCursor

public TimeCursor(long at,
                  Timer t)
Construct a TimeCursor.

Parameters:
at - The time at which to trigger.
t - The timer used to measure the time.
Method Detail

toString

public java.lang.String toString()

next

public boolean next()
Used to test if the Cursor is true. Returns true on the first call at or after the time has arrived. Calls before or after this will return false, until reset(Generator, int) is called.

Specified by:
next in class Cursor
Returns:
True for first call at/after the correct time, false otherwise.

reset

public Cursor reset(aos.jack.jak.core.Generator g,
                    int index)
Resets the cursor so a call to next() will return if the correct time has passed.

Overrides:
reset in class Cursor
Parameters:
g - Not used, as there is no need to generate a new cursor.
index - Not used, as there is no need to generate a new cursor.
Returns:
the reset Cursor.

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()
Description copied from class: Cursor
Used by JACK to determine if the cursor provides triggering. It is used by JACK to flag errors if an attempt is made to wait for or maintain a cursor that does not provide triggering.

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