org.apache.avalon.cornerstone.blocks.scheduler
Class TimeScheduledEntry

java.lang.Object
  extended byorg.apache.avalon.cornerstone.blocks.scheduler.TimeScheduledEntry
All Implemented Interfaces:
java.lang.Comparable

public final class TimeScheduledEntry
extends java.lang.Object
implements java.lang.Comparable

Class use internally to package to hold scheduled time entries.

Author:
Avalon Development Team

Constructor Summary
TimeScheduledEntry(java.lang.String name, TimeTrigger trigger, Target target)
           
 
Method Summary
 int compareTo(java.lang.Object object)
          Implement comparable interface used to help sort triggers.
 java.lang.String getName()
          Return name of trigger.
 long getNextTime()
          Retrieve cached time when trigger should run next.
 Target getTarget()
           
 TimeTrigger getTimeTrigger()
           
 void invalidate()
          Invalidate trigger
 boolean isValid()
          Determine if this entry is valid
 void setNextTime(long time)
          Set cached time in milliseconds when trigger should run
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TimeScheduledEntry

public TimeScheduledEntry(java.lang.String name,
                          TimeTrigger trigger,
                          Target target)
Method Detail

getName

public java.lang.String getName()
Return name of trigger.

Returns:
the name of trigger

getTarget

public Target getTarget()

getTimeTrigger

public TimeTrigger getTimeTrigger()

isValid

public boolean isValid()
Determine if this entry is valid

Returns:
true if trigger is valid, false otherwise

invalidate

public void invalidate()
Invalidate trigger


getNextTime

public long getNextTime()
Retrieve cached time when trigger should run next.

Returns:
the time in milliseconds when trigger should run

setNextTime

public void setNextTime(long time)
Set cached time in milliseconds when trigger should run

Parameters:
time - the time

compareTo

public int compareTo(java.lang.Object object)
Implement comparable interface used to help sort triggers. Triggers are compared based on next time to run

Specified by:
compareTo in interface java.lang.Comparable
Parameters:
object - the other trigger
Returns:
-'ve value if other trigger occurs before this trigger

toString

public java.lang.String toString()


Copyright © 1997-2005 The Apache Software Foundation. All Rights Reserved.