jgnash.engine.recurring
Class Reminder

java.lang.Object
  extended by jgnash.engine.StoredObject
      extended by jgnash.engine.recurring.Reminder
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.lang.Comparable<Reminder>
Direct Known Subclasses:
DailyReminder, MonthlyReminder, OneTimeReminder, WeeklyReminder, YearlyReminder

public abstract class Reminder
extends StoredObject
implements java.lang.Comparable<Reminder>, java.lang.Cloneable

This is an abstract class for scheduled reminders.

Version:
$Id$
Author:
Craig Cavanaugh
See Also:
Serialized Form

Field Summary
private  Account account
           
private  boolean autoCreate
          Create the transaction automatically
private  boolean autoCreateNotify
          Display notice of the automatically created transaction
private  int daysAdvance
          Number of days to notify in advance
private  java.lang.String description
          Description for this reminder
private  boolean enabled
          Enabled state
private  java.util.Date endDate
          The last date the reminder will stop executing, may be null (Bug #2860259)
private  int increment
          Number of periods to increment between events
private  java.util.Date lastDate
          The last date the reminder was executed It should remain an increment of the iterator for correct operation
private  java.lang.String notes
          Notes for this reminder
private  boolean removable
          Delete on completion
private static long serialVersionUID
           
private  java.util.Date startDate
          The start date of this reminder
private  Transaction transaction
          Reference to the transaction for this reminder.
 
Constructor Summary
Reminder()
           
 
Method Summary
 java.lang.Object clone()
           
 int compareTo(Reminder reminder)
           
 boolean equals(java.lang.Object obj)
          Default equals override
 Account getAccount()
           
 int getDaysAdvance()
           
 java.lang.String getDescription()
           
 java.util.Date getEndDate()
           
 int getIncrement()
           
abstract  RecurringIterator getIterator()
           
 java.util.Date getLastDate()
           
 java.lang.String getNotes()
           
abstract  ReminderType getReminderType()
           
 java.util.Date getStartDate()
           
 Transaction getTransaction()
          Returns a clone of the transaction.
 int hashCode()
          Overrides the super and returns the object id.
 boolean isAutoCreate()
           
 boolean isAutoCreateNotify()
           
 boolean isEnabled()
          Getter for property enabled.
 boolean isRemovable()
           
 void setAccount(Account account)
           
 void setAutoCreate(boolean autoCreate)
           
 void setAutoCreateNotify(boolean autoCreateNotify)
           
 void setDaysAdvance(int advanceRemindDays)
           
 void setDescription(java.lang.String description)
           
 void setEnabled(boolean enabled)
          Setter for property enabled.
 void setEndDate(java.util.Date endDate)
           
 void setIncrement(int increment)
           
 java.util.Date setLastDate()
          Sets the last date fired to the next iterator date in the series
private  void setLastDate(java.util.Date lastDate)
           
 void setNotes(java.lang.String notes)
           
 void setRemovable(boolean removable)
           
 void setStartDate(java.util.Date startDate)
           
 void setTransaction(Transaction transaction)
           
 java.lang.String toString()
           
 
Methods inherited from class jgnash.engine.StoredObject
getUuid, isMarkedForRemoval
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

daysAdvance

private int daysAdvance
Number of days to notify in advance


autoCreate

private boolean autoCreate
Create the transaction automatically


autoCreateNotify

private boolean autoCreateNotify
Display notice of the automatically created transaction


description

private java.lang.String description
Description for this reminder


enabled

private boolean enabled
Enabled state


endDate

private java.util.Date endDate
The last date the reminder will stop executing, may be null (Bug #2860259)


increment

private int increment
Number of periods to increment between events


lastDate

private java.util.Date lastDate
The last date the reminder was executed It should remain an increment of the iterator for correct operation


notes

private java.lang.String notes
Notes for this reminder


removable

private boolean removable
Delete on completion


startDate

private java.util.Date startDate
The start date of this reminder


account

private Account account

transaction

private Transaction transaction
Reference to the transaction for this reminder. This transaction is not store in the IDMap.

Constructor Detail

Reminder

public Reminder()
Method Detail

compareTo

public int compareTo(Reminder reminder)
Specified by:
compareTo in interface java.lang.Comparable<Reminder>

getDaysAdvance

public int getDaysAdvance()
Returns:
Returns the advanceRemindDays.

getDescription

public java.lang.String getDescription()
Returns:
Returns the description.

getEndDate

public java.util.Date getEndDate()
Returns:
Returns the last date the reminder should execute.

getIterator

public abstract RecurringIterator getIterator()
Returns:
Returns the iterator.

getLastDate

public java.util.Date getLastDate()
Returns:
Returns a clone of the lastDate.

getStartDate

public java.util.Date getStartDate()
Returns:
Returns a clone of the startDate.

getTransaction

public Transaction getTransaction()
Returns a clone of the transaction. A clone is returned to prevent accidental insertion of the original into the engine.

Returns:
Returns the transaction.

getReminderType

public abstract ReminderType getReminderType()

hashCode

public final int hashCode()
Overrides the super and returns the object id.

Overrides:
hashCode in class StoredObject
Returns:
returns the hashCode;
See Also:
Object.hashCode()

equals

public boolean equals(java.lang.Object obj)
Description copied from class: StoredObject
Default equals override

Overrides:
equals in class StoredObject
Parameters:
obj - object to compare
See Also:
Object.equals(java.lang.Object)

isAutoCreate

public boolean isAutoCreate()
Returns:
Returns the autoCreate.

isAutoCreateNotify

public boolean isAutoCreateNotify()
Returns:
Returns the autoCreateNotify.

isEnabled

public boolean isEnabled()
Getter for property enabled.

Returns:
Value of property enabled.

isRemovable

public boolean isRemovable()
Returns:
Returns the removable.

setDaysAdvance

public void setDaysAdvance(int advanceRemindDays)
Parameters:
advanceRemindDays - The advanceRemindDays to set.

setAutoCreate

public void setAutoCreate(boolean autoCreate)
Parameters:
autoCreate - The autoCreate to set.

setAutoCreateNotify

public void setAutoCreateNotify(boolean autoCreateNotify)
Parameters:
autoCreateNotify - The autoCreateNotify to set.

setDescription

public void setDescription(java.lang.String description)
Parameters:
description - The description to set.

setEnabled

public void setEnabled(boolean enabled)
Setter for property enabled.

Parameters:
enabled - New value of property enabled.

setEndDate

public void setEndDate(java.util.Date endDate)
Parameters:
endDate - The last date the reminder should execute.

setLastDate

private void setLastDate(java.util.Date lastDate)
Parameters:
lastDate - The lastDate to set.

setLastDate

public java.util.Date setLastDate()
Sets the last date fired to the next iterator date in the series

Returns:
the next iterator date

setRemovable

public void setRemovable(boolean removable)
Parameters:
removable - The removable to set.

setStartDate

public void setStartDate(java.util.Date startDate)
Parameters:
startDate - The startDate to set.

setTransaction

public void setTransaction(Transaction transaction)
Parameters:
transaction - The transaction to set.

getIncrement

public int getIncrement()
Returns:
Returns the increment.

setIncrement

public void setIncrement(int increment)
Parameters:
increment - The increment to set.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

setNotes

public void setNotes(java.lang.String notes)
Parameters:
notes - The notes to set.

getNotes

public java.lang.String getNotes()
Returns:
Returns the notes.

setAccount

public void setAccount(Account account)
Parameters:
account - base account for this Reminder

getAccount

public Account getAccount()
Returns:
Returns the accountId.

clone

public java.lang.Object clone()
Overrides:
clone in class StoredObject