agentland.util.scheduler
Class ReminderRecord
java.lang.Object
|
+--agentland.util.scheduler.ReminderRecord
- All Implemented Interfaces:
- Comparable, Serializable
- Direct Known Subclasses:
- IntervalReminder, OneTimeReminder
- public abstract class ReminderRecord
- extends Object
- implements Serializable, Comparable
- See Also:
- Serialized Form
NEVER
public static final long NEVER
method
protected String method
message
protected Serializable message
aid
protected AgentID aid
id
protected long id
wakeup
protected boolean wakeup
expiresAfter
protected long expiresAfter
ReminderRecord
public ReminderRecord(AgentID aid,
String method,
Serializable message)
ReminderRecord
public ReminderRecord(AgentID aid,
String method,
Serializable message,
boolean wakeup)
nextActivation
public abstract long nextActivation()
reminderIssued
public abstract void reminderIssued(long time)
- After reminding an agent, you should notify the ReminderRecord
about it (so that it knows reminder has been issued and is not
past due)
compareTo
public int compareTo(Object o)
throws ClassCastException
- Specified by:
compareTo
in interface Comparable
getMethodName
public String getMethodName()
getMessage
public Serializable getMessage()
getAgentID
public AgentID getAgentID()
getID
public long getID()
setID
public void setID(long id)
getWakeup
public boolean getWakeup()
setExpiresAfter
public void setExpiresAfter(long exp)
- Set the (relative) time after which the reminder will no longer
make sense; this is for overdue reminders (if the system is
down when the reminder has to be issued and gets up after the
reminder was due, when would it make sense to still issue the
reminder and when it would not...
getExpiresAfter
public long getExpiresAfter()
dead
public boolean dead()
- Return true if the reminder is dead (either issued or worthless)
futureTime
public static long futureTime(int number,
String unit)
timeFromNow
public static long timeFromNow(int number,
String unit)
- Return a time duration in milliseconds.
- Parameters:
unit
- The units of number. You have "sec", "min",
"hours", or "days"- Returns:
- length of time in milliseconds.
timeInMillis
public static long timeInMillis(int number,
String unit)
- Return a time duration in milliseconds.
- Parameters:
unit
- The units of number. You have "sec", "min",
"hours", or "days"- Returns:
- length of time in milliseconds.
toString
public String toString()
- Overrides:
toString
in class Object