public class Event
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
(package private) java.lang.String |
description
Detailed description of the event.
|
(package private) int |
duration
Duration -in seconds- of the event.
|
(package private) int |
period
Time -in seconds- it takes to repeat the event.
|
(package private) int |
startingHour
Decomposition of the 'startingTime' in hours, minutes and seconds.
|
(package private) int |
startingMinute
Decomposition of the 'startingTime' in hours, minutes and seconds.
|
(package private) int |
startingSecond
Decomposition of the 'startingTime' in hours, minutes and seconds.
|
(package private) boolean |
startingTime
Establishes if the event shall be executed only at a certain time.
|
(package private) int |
timeToLaunch
Remaining time -in seconds- until event starts.
|
(package private) java.lang.String |
title
Title of the event, short and accurate.
|
Constructor and Description |
---|
Event(Event e)
Creates event from an existing one.
|
Event(java.lang.String title,
java.lang.String description,
int period,
int duration,
boolean startingTime,
int startingHour,
int startingMinute,
int startingSecond)
Creates an Event.
|
Modifier and Type | Method and Description |
---|---|
void |
decreaseTTL()
Decreases TimeToLaunch (TTL) value in one unit.
|
java.lang.String |
getDescription() |
int |
getDuration() |
int |
getPeriod() |
int |
getStartingHour() |
int |
getStartingMin() |
int |
getStartingSecond() |
boolean |
getStartingTime() |
int |
getTimeToLaunch() |
java.lang.String |
getTitle() |
void |
restartTimeToLaunch()
Restarts 'timeToLaunch' to its initial value, equal to event's period.
|
void |
setPeriod(int period)
Modifies event's period value.
|
void |
setTimeToLaunch(int currentTime)
Modifies 'timeToLaunch' value.
|
java.lang.String title
java.lang.String description
int period
int duration
int timeToLaunch
boolean startingTime
int startingHour
int startingMinute
int startingSecond
public Event(java.lang.String title, java.lang.String description, int period, int duration, boolean startingTime, int startingHour, int startingMinute, int startingSecond)
title
- title of the event.description
- description of the event.period
- in seconds, period of the event (how often it occurs).duration
- in seconds, duration of the event.startingTime
- True if event shall start at a specific time.startingHour
- specific starting hour (0 to 23).startingMinute
- specific starting minute (0 to 59).startingSecond
- specific starting second (0 to 59).public Event(Event e)
e
- original event to be copied in the created one.public void decreaseTTL()
public void restartTimeToLaunch()
public java.lang.String getTitle()
public int getPeriod()
public int getDuration()
public int getTimeToLaunch()
public java.lang.String getDescription()
public boolean getStartingTime()
public int getStartingHour()
public int getStartingMin()
public int getStartingSecond()
public void setTimeToLaunch(int currentTime)
currentTime
- value to be assigned to 'timeToLaunch'.public void setPeriod(int period)
period
- value to be assigned to the period.