de.jaret.examples.timebars.calendar.model
Class Appointment

java.lang.Object
  extended by de.jaret.util.misc.PropertyObservableBase
      extended by de.jaret.util.date.IntervalImpl
          extended by de.jaret.examples.timebars.calendar.model.Appointment
All Implemented Interfaces:
de.jaret.util.date.Interval, de.jaret.util.misc.PropertyObservable, java.beans.PropertyChangeListener, java.util.EventListener

public class Appointment
extends de.jaret.util.date.IntervalImpl

Extension of the interval class, always projecting in the same base date, thus the time is relevant.

Version:
$Id: Appointment.java 705 2008-01-25 22:51:54Z kliem $
Author:
Peter Kliem

Nested Class Summary
static class Appointment.Status
          enumeration for the possible states.
 
Field Summary
protected  java.lang.String _description
           
protected  boolean _editable
           
protected  java.lang.Object _extension
          extension object to be used by the synchronizers.
protected  java.lang.String _id
           
protected  de.jaret.util.date.JaretDate _lastChangeDate
          timestamp of the lst change.
protected  java.lang.String _lastChangerId
          id of the last changing logic: either a synchronizer or the calendar plugin id. changer always defaults to the plugin, synchronizers have to set it after doing an update.
protected  de.jaret.util.date.JaretDate _lastChecked
          date the appointment has been checked against its source the last time.
protected  de.jaret.util.date.JaretDate _realBegin
          the real begin including the date.
protected  de.jaret.util.date.JaretDate _realEnd
          the real end including the date.
protected  boolean _recurring
          true if the event is part of a series.
protected  boolean _spansMultipleDays
          true whenever the appointment (realBegin/end) spans a whole day or more than one day.
protected  Appointment.Status _status
           
protected  java.lang.String _synchronizerId
          the synchronizer id caring for this appointment.
protected  java.lang.String _text
           
 
Fields inherited from class de.jaret.util.date.IntervalImpl
_begin, _end
 
Fields inherited from class de.jaret.util.misc.PropertyObservableBase
_propertyChangeSupport
 
Fields inherited from interface de.jaret.util.date.Interval
PROP_BEGIN, PROP_END
 
Constructor Summary
Appointment(de.jaret.util.date.JaretDate date, int h, int m, double durH, java.lang.String text)
           
Appointment(de.jaret.util.date.JaretDate begin, de.jaret.util.date.JaretDate end, java.lang.String text)
           
Appointment(java.lang.String id)
          Construct a basic appointment.
 
Method Summary
protected  void changed()
           
 Appointment copy()
          Create a copy of the appointment.
 java.lang.String getDescription()
           
 java.lang.Object getExtension()
           
 java.lang.String getId()
           
 de.jaret.util.date.JaretDate getLastChangeDate()
           
 java.lang.String getLastChangerId()
           
 de.jaret.util.date.JaretDate getLastChecked()
           
 de.jaret.util.date.JaretDate getRealBegin()
           
 de.jaret.util.date.JaretDate getRealEnd()
           
 Appointment.Status getStatus()
           
 java.lang.String getSynchronizerId()
           
 java.lang.String getText()
           
 boolean isEditable()
           
 boolean isRecurring()
           
 boolean isSpansMultipleDays()
           
 boolean isWholeDayAppointment()
          Check whether the appointment is a whole day event.
 void setBegin(de.jaret.util.date.JaretDate begin)
           
 void setDescription(java.lang.String description)
           
 void setEditable(boolean editable)
           
 void setEnd(de.jaret.util.date.JaretDate end)
           
 void setExtension(java.lang.Object extension)
           
 void setId(java.lang.String id)
           
 void setLastChangeDate(de.jaret.util.date.JaretDate lastChangeDate)
           
 void setLastChangerId(java.lang.String lastChangerId)
           
 void setLastChecked(de.jaret.util.date.JaretDate lastChecked)
           
 void setRealBegin(de.jaret.util.date.JaretDate realBegin)
           
 void setRealEnd(de.jaret.util.date.JaretDate realEnd)
           
 void setRecurring(boolean recurring)
           
protected  void setSpansMultipleDays(boolean spansMultipleDays)
           
 void setStatus(Appointment.Status status)
           
 void setSynchronizerId(java.lang.String synchronizerId)
           
 void setText(java.lang.String text)
           
 java.lang.String toDisplayString()
          Create a string representation suitable for display.
 
Methods inherited from class de.jaret.util.date.IntervalImpl
contains, contains, containsNonIncluding, containsStatic, getBegin, getEnd, getSeconds, intersect, intersectNonIncluding, intersects, propertyChange, toString
 
Methods inherited from class de.jaret.util.misc.PropertyObservableBase
addPropertyChangeListener, firePropertyChange, isRealModification, removePropertyChangeListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface de.jaret.util.misc.PropertyObservable
addPropertyChangeListener, removePropertyChangeListener
 

Field Detail

_realBegin

protected de.jaret.util.date.JaretDate _realBegin
the real begin including the date.


_realEnd

protected de.jaret.util.date.JaretDate _realEnd
the real end including the date.


_text

protected java.lang.String _text

_description

protected java.lang.String _description

_id

protected java.lang.String _id

_status

protected Appointment.Status _status

_recurring

protected boolean _recurring
true if the event is part of a series.


_editable

protected boolean _editable

_extension

protected java.lang.Object _extension
extension object to be used by the synchronizers.


_spansMultipleDays

protected boolean _spansMultipleDays
true whenever the appointment (realBegin/end) spans a whole day or more than one day.


_synchronizerId

protected java.lang.String _synchronizerId
the synchronizer id caring for this appointment.


_lastChecked

protected de.jaret.util.date.JaretDate _lastChecked
date the appointment has been checked against its source the last time.


_lastChangerId

protected java.lang.String _lastChangerId
id of the last changing logic: either a synchronizer or the calendar plugin id. changer always defaults to the plugin, synchronizers have to set it after doing an update.


_lastChangeDate

protected de.jaret.util.date.JaretDate _lastChangeDate
timestamp of the lst change.

Constructor Detail

Appointment

public Appointment(java.lang.String id)
Construct a basic appointment. Begin and end have to be set seperately!

Parameters:
id - id to use

Appointment

public Appointment(de.jaret.util.date.JaretDate date,
                   int h,
                   int m,
                   double durH,
                   java.lang.String text)

Appointment

public Appointment(de.jaret.util.date.JaretDate begin,
                   de.jaret.util.date.JaretDate end,
                   java.lang.String text)
Method Detail

copy

public Appointment copy()
Create a copy of the appointment. This method should be overriden by extending classes.

Returns:
a copy of the interval that does not include the meta information (synchronizer, changer, timestamps)

changed

protected void changed()

getRealBegin

public de.jaret.util.date.JaretDate getRealBegin()

setRealBegin

public void setRealBegin(de.jaret.util.date.JaretDate realBegin)

getRealEnd

public de.jaret.util.date.JaretDate getRealEnd()

setRealEnd

public void setRealEnd(de.jaret.util.date.JaretDate realEnd)

setBegin

public void setBegin(de.jaret.util.date.JaretDate begin)
Specified by:
setBegin in interface de.jaret.util.date.Interval
Overrides:
setBegin in class de.jaret.util.date.IntervalImpl

setEnd

public void setEnd(de.jaret.util.date.JaretDate end)
Specified by:
setEnd in interface de.jaret.util.date.Interval
Overrides:
setEnd in class de.jaret.util.date.IntervalImpl

getText

public java.lang.String getText()

setText

public void setText(java.lang.String text)

getDescription

public java.lang.String getDescription()

setDescription

public void setDescription(java.lang.String description)

getId

public java.lang.String getId()

setId

public void setId(java.lang.String id)

getSynchronizerId

public java.lang.String getSynchronizerId()

setSynchronizerId

public void setSynchronizerId(java.lang.String synchronizerId)

getLastChecked

public de.jaret.util.date.JaretDate getLastChecked()

setLastChecked

public void setLastChecked(de.jaret.util.date.JaretDate lastChecked)

getLastChangerId

public java.lang.String getLastChangerId()

setLastChangerId

public void setLastChangerId(java.lang.String lastChangerId)

getLastChangeDate

public de.jaret.util.date.JaretDate getLastChangeDate()

setLastChangeDate

public void setLastChangeDate(de.jaret.util.date.JaretDate lastChangeDate)

getStatus

public Appointment.Status getStatus()

setStatus

public void setStatus(Appointment.Status status)

isRecurring

public boolean isRecurring()

setRecurring

public void setRecurring(boolean recurring)

isEditable

public boolean isEditable()

setEditable

public void setEditable(boolean editable)

isSpansMultipleDays

public boolean isSpansMultipleDays()

setSpansMultipleDays

protected void setSpansMultipleDays(boolean spansMultipleDays)

isWholeDayAppointment

public boolean isWholeDayAppointment()
Check whether the appointment is a whole day event.

Returns:
true if begin and end time are 00:00

getExtension

public java.lang.Object getExtension()

setExtension

public void setExtension(java.lang.Object extension)

toDisplayString

public java.lang.String toDisplayString()
Create a string representation suitable for display.

Returns:
string representation


Copyright © 2012. All Rights Reserved.