Top Description Fields Constructors Methods
com.calendarfx.model

public Class Entry<T>

extends Object
implements Comparable<Entry<?>>
Class Inheritance
All Implemented Interfaces
java.lang.Comparable
Known Direct Subclasses
com.calendarfx.view.DraggedEntry
Type Parameters
<T>
the type of the user object
Imports
impl.com.calendarfx.view.util.Util, javafx.beans.property.BooleanProperty, .ObjectProperty, .ReadOnlyBooleanProperty, .ReadOnlyBooleanWrapper, .ReadOnlyObjectProperty, .ReadOnlyObjectWrapper, .ReadOnlyStringProperty, .ReadOnlyStringWrapper, .SimpleBooleanProperty, .SimpleObjectProperty, .SimpleStringProperty, .StringProperty, javafx.beans.value.ObservableValue, javafx.collections.FXCollections, .MapChangeListener, .ObservableList, .ObservableMap, net.fortuna.ical4j.model.Recur, org.controlsfx.control.PropertySheet.Item, java.time.Duration, .LocalDate, .LocalDateTime, .LocalTime, .ZoneId, .ZonedDateTime, java.time.format.DateTimeParseException, java.util.HashMap, .List, .Objects, .Optional, .UUID

An entry inside a calendar, for example "Dentist Appointment, Feb 2nd, 9am". Entries are added to and managed by calendars. The main attributes of an entry are: The default minimum duration of an entry is 15 minutes.

Visual Appearance

The image below shows an entry called "dentist appointment" as it would be visualized via an com.calendarfx.view.DayEntryView inside a com.calendarfx.view.DayView. Entry

Recurrence

This class supports the industry standard for defining recurring events (RFC 2445). For recurring events the method setRecurrenceRule(String) must be fed with a valid RRULE string, for example "RRULE:FREQ=DAILY" for an event that occures every day. The calendar to which the entry belongs is then responsible for creating the recurring entries when its Calendar#findEntries(LocalDate, LocalDate, ZoneId) method gets invoked. Recurring entries will return "true" when their isRecurrence() method is called and they will also be able to return the "source" entry (getRecurrenceSourceEntry()).

Example

Entry entry = new Entry("Dentist Appointment");
Interval interval = new Interval(...);
entry.setInterval(interval);
entry.setRecurrenceRule("RRULE:FREQ=DAILY;INTERVAL=2;");

Calendar calendar = new Calendar("Health");
calendar.addEntry(entry);

Field Summary

Modifier and TypeField and Description
private Duration
private boolean
private boolean
private LocalDate
private String
private final SimpleObjectProperty<Calendar<T>>
private static final Duration
private ReadOnlyObjectWrapper<LocalDate>
private ReadOnlyObjectWrapper<LocalTime>
private static final String
private final BooleanProperty
private final BooleanProperty
private String
private final ObjectProperty<Interval>
private StringProperty
private ObjectProperty<Duration>
private ReadOnlyBooleanWrapper
private ObservableMap<Object, Object>
private ReadOnlyBooleanWrapper
private ReadOnlyObjectWrapper<LocalDate>
private ReadOnlyStringWrapper
private StringProperty
private ReadOnlyObjectWrapper<Entry<T>>
private ReadOnlyObjectWrapper<LocalDate>
private ReadOnlyObjectWrapper<LocalTime>
private ObservableList<String>
private final StringProperty
private ObjectProperty<T>
private ReadOnlyObjectWrapper<ZoneId>

Constructor Summary

AccessConstructor and Description
public
Entry()

Constructs a new entry with a default time interval.

public
Entry(String
the title shown to the user
title
)

Constructs a new entry with the given title and a default time interval.

public
Entry(String
the title shown to the user
title
,
String
the unique id of the entry
id
)

Constructs a new entry with the given title, a default time interval, and the given ID.

public
Entry(String
the title shown to the user
title
,
Interval
the time interval where the entry is located
interval
)

Constructs a new entry with the given title.

public
Entry(String
the title shown to the user
title
,
Interval
the time interval where the entry is located
interval
,
String
a unique ID, e.g. UUID.randomUUID();
id
)

Constructs a new entry with the given title.

Method Summary

Modifier and TypeMethod and Description
public final ObjectProperty<Calendar<T>>

Returns:

the calendar property
calendarProperty
()

A property used to store a reference to the calendar that owns the entry.

public final void
changeEndDate(LocalDate
the new end date
date
)

Changes the end date of the entry interval and ensures that the entry's interval stays valid, which means that the start time will be before the end time and that the duration of the entry will be at least the duration defined by the minimumDurationProperty().

public final void
changeEndDate(LocalDate
the new end date
date
,
boolean
if true then this method will also change the start date and time in such a way that the total duration of the entry will not change. If false then this method will ensure that the entry's interval stays valid, which means that the start time will be before the end time and that the duration of the entry will be at least the duration defined by the minimumDurationProperty().
keepDuration
)

Changes the end date of the entry interval.

public final void
changeEndTime(LocalTime
the new end time
time
)

Changes the end time of the entry interval and ensures that the entry's interval stays valid, which means that the start time will be before the end time and that the duration of the entry will be at least the duration defined by the minimumDurationProperty().

public final void
changeEndTime(LocalTime
the new end time
time
,
boolean
if true then this method will also change the start time in such a way that the total duration of the entry will not change. If false then this method will ensure that the entry's interval stays valid, which means that the start time will be before the end time and that the duration of the entry will be at least the duration defined by the minimumDurationProperty().
keepDuration
)

Changes the end time of the entry interval.

public final void
changeStartDate(LocalDate
the new start date
date
)

Changes the start date of the entry interval and ensures that the entry's interval stays valid, which means that the start time will be before the end time and that the duration of the entry will be at least the duration defined by the minimumDurationProperty().

public final void
changeStartDate(LocalDate
the new start date
date
,
boolean
if true then this method will also change the end date and time in such a way that the total duration of the entry will not change. If false then this method will ensure that the entry's interval stays valid, which means that the start time will be before the end time and that the duration of the entry will be at least the duration defined by the minimumDurationProperty().
keepDuration
)

Changes the start date of the entry interval.

public final void
changeStartTime(LocalTime
the new start time
time
)

Changes the start time of the entry interval and ensures that the entry's interval stays valid, which means that the start time will be before the end time and that the duration of the entry will be at least the duration defined by the minimumDurationProperty().

public final void
changeStartTime(LocalTime
the new start time
time
,
boolean
if true then this method will also change the end time in such a way that the total duration of the entry will not change. If false then this method will ensure that the entry's interval stays valid, which means that the start time will be before the end time and that the duration of the entry will be at least the duration defined by the minimumDurationProperty().
keepDuration
)

Changes the start time of the entry interval.

public final void
changeZoneId(ZoneId
the new zone
zoneId
)

Changes the zone ID of the entry interval.

public final int
compareTo(Entry<?>
the object to be compared.
other
)

Implements java.lang.Comparable.compareTo.

Compares this object with the specified object for order.

public Entry<T>

Returns:

a recurrence "copy" of the entry.
createRecurrence
()

If the entry defines a recurrence rule (see recurrenceRuleProperty()) then the calendar will use this method to create one or more "copies" of the entry.

public final ReadOnlyObjectProperty<LocalDate>

Returns:

the end date of the entry
endDateProperty
()

A read-only property used for retrieving the end date of the entry.

public final ReadOnlyObjectProperty<LocalTime>

Returns:

the end time of the entry
endTimeProperty
()

A read-only property used for retrieving the end time of the entry.

public boolean
equals(Object
the reference object with which to compare.
obj
)

Overrides java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

public final BooleanProperty

Returns:

the full day property
fullDayProperty
()

A property used to signal whether an entry is considered to be a "full day" entry, for example a birthday.

public final Calendar<T>

Returns:

the owning calendar of this entry
getCalendar
()

Returns the value of calendarProperty().

public final Duration

Returns:

the duration of the entry
getDuration
()

Utility method to calculate the duration of the entry.

public final LocalDateTime

Returns:

the end local date time
getEndAsLocalDateTime
()

Utility method to get the local end date time.

public final ZonedDateTime

Returns:

the zoned end time
getEndAsZonedDateTime
()

Utility method to get the zoned end time.

public final LocalDate

Returns:

the entry's end date
getEndDate
()

Returns the end date of the entry's interval (see intervalProperty()).

public final long

Returns:

the end time in milliseconds
getEndMillis
()

Returns the end time in milliseconds since 1.1.1970.

public final LocalTime

Returns:

the entry's end time
getEndTime
()

Returns the end time of the entry's interval (see intervalProperty()).

public final String

Returns:

the id object
getId
()

Returns the ID of the entry.

public final Interval

Returns:

the time interval used by the entry
getInterval
()

Returns the value of intervalProperty().

public final String

Returns:

the location
getLocation
()

Returns the value of locationProperty().

public final Duration

Returns:

the minimum duration of the entry
getMinimumDuration
()

Returns the value of minimumDurationProperty().

public final ObservableMap<Object, Object>

Returns:

an observable map of properties on this entry for use primarily by application developers
getProperties
()

Returns an observable map of properties on this entry for use primarily by application developers.

public ObservableList<PropertySheet.Item>
public final LocalDate

Returns:

the recurrence rule end time
getRecurrenceEnd
()

Returns the value of recurrenceRuleProperty().

public final String

Returns:

the recurrence ID
getRecurrenceId
()

Returns the value of recurrenceIdProperty().

public final String

Returns:

the recurrence rule
getRecurrenceRule
()

Returns the value of recurrenceRuleProperty().

public final Entry<T>

Returns:

the recurrence source
getRecurrenceSourceEntry
()

Returns the value of recurrenceSourceProperty().

public final LocalDateTime

Returns:

the start local date time
getStartAsLocalDateTime
()

Utility method to get the local start date time.

public final ZonedDateTime

Returns:

the zoned start time
getStartAsZonedDateTime
()

Utility method to get the zoned start time.

public final LocalDate

Returns:

the entry's start date
getStartDate
()

Returns the start date of the entry's interval (see intervalProperty()).

public final long

Returns:

the start time in milliseconds
getStartMillis
()

Returns the start time in milliseconds since 1.1.1970.

public final LocalTime

Returns:

the entry's start time
getStartTime
()

Returns the start time of the entry's interval (see intervalProperty()).

public final ObservableList<String>

Returns:

a list of style classes
getStyleClass
()

Returns a list of style classes.

public final String

Returns:

the title of the entry
getTitle
()

Returns the value of titleProperty().

public final T

Returns:

the user object
getUserObject
()

Returns the value of userObjectProperty().

public final ZoneId

Returns:

the entry's time zone
getZoneId
()

Returns the value of zoneIdProperty().

public int
hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code value for this object.

public final boolean

Returns:

true if the entry has properties.
hasProperties
()

Tests if the entry has properties.

public final boolean

Returns:

true if the entry defines any styles on its own
hasStyleClass
()

Checks whether the entry has defined any custom styles at all.

public final BooleanProperty
public final boolean

Returns:

true if the entries' time bounds overlap
intersects
(Entry<?>
the other entry to check
entry
)

Utility method to determine if this entry and the given entry intersect each other (time bounds overlap each other).

public final boolean

Returns:

true if the entry and the given time interval overlap
intersects
(ZonedDateTime
time interval start
startTime
,
ZonedDateTime
time interval end
endTime
)

Utility method to determine if this entry and the given time interval intersect each other (time bounds overlap each other).

public final ObjectProperty<Interval>

Returns:

the time interval used by the entry
intervalProperty
()

A property used to store the time interval occupied by this entry.

public final boolean

Returns:

true if the entry is a full day entry, e.g. a birthday
isFullDay
()

Returns the value of fullDayProperty().

public final boolean
public final boolean

Returns:

true if the entry spans multiple days
isMultiDay
()

Returns the value of multiDayProperty().

public final boolean

Returns:

true if the entry is a recurrence copy
isRecurrence
()

Returns the value of recurrenceProperty().

private boolean
public final boolean

Returns:

true if the entry is recurring
isRecurring
()

Determines if the entry describes a recurring event.

public final boolean

Returns:

true if the entry or any of its recurrences is showing
isShowing
(LocalDate
the start date of the search interval
startDate
,
LocalDate
the end date of the search interval
endDate
,
ZoneId
the time zone
zoneId
)

Checks whether the entry will be visible within the given start and end dates.

private boolean
isShowing(Entry<?> entry, LocalDate startDate, LocalDate endDate, ZoneId zoneId)

public final StringProperty

Returns:

the location of the event specified by the entry
locationProperty
()

A property used to store a free-text location specification for the given entry.

public boolean

Returns:

true if the entry matches the given search term
matches
(String
the search term
searchTerm
)

Used by the Calendar#findEntries(String) to find entries based on a text search.

public final ObjectProperty<Duration>

Returns:

the minimum duration of the entry
minimumDurationProperty
()

A property used to store the minimum duration an entry can have.

public final ReadOnlyBooleanProperty

Returns:

true if the end date is after the start date (multiple days)
multiDayProperty
()

A read-only property to determine if the entry spans several days.

public final ReadOnlyObjectProperty<LocalDate>

Returns:

the recurrence rule end time
recurrenceEndProperty
()

The property used to store the end time of the recurrence rule.

public final ReadOnlyStringProperty

Returns:

the recurrence ID property
recurrenceIdProperty
()

Stores the recurrence ID which is being generated on-the-fly by the Calendar to which the recurrence source entry belongs.

public final ReadOnlyBooleanProperty

Returns:

true if the entry is a recurrence copy
recurrenceProperty
()

A read-only property used to indicate whether the entry is a recurrence copy of a recurrence source.

public final StringProperty

Returns:

the recurrenceRule property
recurrenceRuleProperty
()

A property used to store a recurrence rule according to RFC-2445.

public final ReadOnlyObjectProperty<Entry<T>>

Returns:

the entry that was the source of the recurrence
recurrenceSourceProperty
()

If the entry is a recurrence (see recurrenceProperty()) then this property will store a reference to the entry for which the recurrence was created.

public final void
removeFromCalendar()

A convenience method to easily remove the entry from its calendar.

public final void
setCalendar(Calendar<T>
the new owning calendar of this entry
cal
)

Sets the value of calendarProperty().

public final void
setFullDay(boolean
true if entry is a full day entry, e.g. a birthday
fullDay
)

Sets the value of fullDayProperty().

public final void
setHidden(boolean
true if the entry should not be visible in the calendar
hidden
)

An entry can be made explicitly hidden.

public final void
setId(String
the new ID of the entry
id
)

Assigns a new ID to the entry.

public final void
setInterval(Interval
the new time interval used by the entry
interval
)

Sets the value of intervalProperty().

public final void
public final void
public final void
setInterval(LocalDate startDate, LocalDate endDate)

public final void
setInterval(LocalDate startDate, LocalDate endDate, ZoneId zoneId)

public final void
setInterval(LocalDate startDate, LocalTime startTime, LocalDate endDate, LocalTime endTime)

public final void
setInterval(LocalDate startDate, LocalTime startTime, LocalDate endDate, LocalTime endTime, ZoneId zoneId)

public final void
setInterval(LocalTime startTime, LocalTime endTime)

public final void
setInterval(LocalTime startTime, LocalTime endTime, ZoneId zoneId)

public final void
public final void
setInterval(LocalDateTime dateTime, ZoneId zoneId)

public final void
setInterval(LocalDateTime startDateTime, LocalDateTime endDateTime)

public final void
setInterval(LocalDateTime startDateTime, LocalDateTime endDateTime, ZoneId zoneId)

public final void
public final void
public final void
setLocation(String
the new location
loc
)

Sets the value of locationProperty().

public final void
setMinimumDuration(Duration
the minimum duration
duration
)

Sets the value of minimumDurationProperty().

private void
setMultiDay(boolean b)

private void
setRecurrence(boolean b)

private void
private void
public final void
setRecurrenceRule(String
the new recurrence rule
rec
)

Sets the value of recurrenceRuleProperty().

public final void
setTitle(String
the title shown by the entry
title
)

Sets the value of titleProperty().

public final void
setUserObject(T
the new user object
object
)

Sets the value of userObjectProperty().

public final void
setZoneId(ZoneId
the new time zone to use for this entry
zoneId
)

Sets the value of zoneIdProperty().

public final ReadOnlyObjectProperty<LocalDate>

Returns:

the start date of the entry
startDateProperty
()

A read-only property used for retrieving the start date of the entry.

public final ReadOnlyObjectProperty<LocalTime>

Returns:

the start time of the entry
startTimeProperty
()

A read-only property used for retrieving the start time of the entry.

public final StringProperty

Returns:

the title property
titleProperty
()

A property used to store the title of the entry.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

private void
public final ObjectProperty<T>

Returns:

the user object property
userObjectProperty
()

A property used to store a reference to an optional user object.

public final ReadOnlyObjectProperty<ZoneId>

Returns:

the time zone property
zoneIdProperty
()

A property used to store a time zone for the entry.

Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAllwaitwaitwait