Class SimpleEvent

java.lang.Object
com.groiss.cal.SimpleEvent
All Implemented Interfaces:
CalEvent, Cloneable

public class SimpleEvent extends Object implements CalEvent
default CalEvent implementation
  • Constructor Details

    • SimpleEvent

      public SimpleEvent()
    • SimpleEvent

      public SimpleEvent(String subject, Date fromDate, Date untilDate)
      constructor
      Parameters:
      subject - the event's subject
      fromDate - the start-date
      untilDate - the end-date
    • SimpleEvent

      public SimpleEvent(CalEvent evt)
      constructor creating a copy of the given event
      Parameters:
      evt - the event
  • Method Details

    • clone

      public Object clone()
      Specified by:
      clone in interface CalEvent
      Overrides:
      clone in class Object
    • getCaption

      public int getCaption()
      returns the caption to use for this event.
      Specified by:
      getCaption in interface CalEvent
      Returns:
      the caption's index CalInfo.getCaptions()
    • getFromDate

      public Date getFromDate()
      Specified by:
      getFromDate in interface CalEvent
      Returns:
      Returns the fromDate.
    • getInterval

      public int getInterval()
      Specified by:
      getInterval in interface CalEvent
      Returns:
      Returns the interval.
    • getLocation

      public String getLocation()
      Specified by:
      getLocation in interface CalEvent
      Returns:
      Returns the location.
    • getRecEndDate

      public Date getRecEndDate()
      Specified by:
      getRecEndDate in interface CalEvent
      Returns:
      Returns the recEndDate.
    • getRecurrenceType

      public int getRecurrenceType()
      Specified by:
      getRecurrenceType in interface CalEvent
      Returns:
      Returns the recurrenceType.
    • getSubject

      public String getSubject()
      Specified by:
      getSubject in interface CalEvent
      Returns:
      Returns the subject.
    • getText

      public String getText()
      Specified by:
      getText in interface CalEvent
      Returns:
      Returns the text.
    • getUID

      public String getUID()
      get the unique identifier for this event
      Specified by:
      getUID in interface CalEvent
      Returns:
      the unique identifier for this event
    • getUntilDate

      public Date getUntilDate()
      Specified by:
      getUntilDate in interface CalEvent
      Returns:
      Returns the untilDate.
    • isPrivateEvent

      public boolean isPrivateEvent()
      Specified by:
      isPrivateEvent in interface CalEvent
      Returns:
      Returns the privateDate.
    • isWholeDay

      public boolean isWholeDay()
      Specified by:
      isWholeDay in interface CalEvent
      Returns:
      Returns the wholeDay.
    • onClick

      public String onClick()
      Specified by:
      onClick in interface CalEvent
      Returns:
      javascript-code for onclick event
    • addObject

      public void addObject(Persistent obj)
    • setCaption

      public void setCaption(int caption)
    • setFromDate

      public void setFromDate(Date fromDate)
    • setInterval

      public void setInterval(int interval)
    • setLocation

      public void setLocation(String location)
    • setOnClick

      public void setOnClick(String onClick)
    • setPrivateEvent

      public void setPrivateEvent(boolean privateEvent)
    • setRecEndDate

      public void setRecEndDate(Date recEndDate)
    • setRecurrenceType

      public void setRecurrenceType(int recurrenceType)
    • setSubject

      public void setSubject(String subject)
    • setText

      public void setText(String text)
    • setUID

      public void setUID(String uid)
    • setUntilDate

      public void setUntilDate(Date untilDate)
    • setWholeDay

      public void setWholeDay(boolean wholeDay)
    • shiftTo

      public void shiftTo(Date begin)
      Shift a recurrent evt to another date and compute the right time
      Parameters:
      begin - the date to shift to
    • getObject

      public Persistent getObject()
      returns the object this CalEvent was initially fetched for
      Specified by:
      getObject in interface CalEvent
      Returns:
      the object
    • getObjects

      public List<Persistent> getObjects()
      the objects, this event belongs to
      Specified by:
      getObjects in interface CalEvent
      Returns:
      the objects
    • setHasReminder

      public void setHasReminder(boolean hasReminder)
    • hasReminder

      public boolean hasReminder()
      should a reminder be used?
      Specified by:
      hasReminder in interface CalEvent
      Returns:
      true or false
    • mayEdit

      public boolean mayEdit(User user)
      check if the given user may edit this event
      Specified by:
      mayEdit in interface CalEvent
      Returns:
      true or false
    • mayView

      public boolean mayView(User user)
      check if the given user may view this event
      Specified by:
      mayView in interface CalEvent
      Returns:
      true or false
    • getEventType

      public EventType getEventType()
      Specified by:
      getEventType in interface CalEvent
      Returns:
      the EventType of this event
    • setEventType

      public void setEventType(EventType eventType)
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • setRecurrenceInterval

      public void setRecurrenceInterval(int interval)
      Parameters:
      interval - sets the recurrence interval
    • setPrivateDate

      public void setPrivateDate(boolean isPrivateDate)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object