public class TimeSlotImpl extends Object implements TimeSlot
| Constructor and Description |
|---|
TimeSlotImpl(LocalDateTime start,
LocalDateTime finish)
Constructs a time slot object.
|
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(TimeSlot other)
Compares this time slot with another one.
|
boolean |
endsAfter(TimeSlot other)
Checks if this time slot ends after the given time slot.
|
boolean |
endsBefore(TimeSlot other)
Checks if this time slot ends before the given time slot.
|
boolean |
equals(Object other)
Tests another time slot object for equality.
|
boolean |
exactlyMatches(TimeSlot other)
Checks if this time slot exactly matches the given time slot.
|
LocalDateTime |
getFinish()
Returns the end of the time slot.
|
LocalDateTime |
getStart()
Returns the start of the time slot.
|
int |
hashCode()
Returns the hash code of this object.
|
boolean |
includes(LocalDateTime dateTime)
Returns true iff NOT (dateTime < this.start() AND dateTime <
this.end()).
|
boolean |
includes(TimeSlot other)
Returns true iff this.includes(ts.start()) && this.includes(ts.end()).
|
boolean |
isEmpty()
Returns true iff start >= end.
|
boolean |
overlaps(TimeSlot other)
Returns true iff ts.includes(this.getStart()) OR
ts.includes(this.getFinish()) OR this.includes(ts).
|
boolean |
startsAfter(TimeSlot other)
Checks if this time slot starts after the given time slot.
|
boolean |
startsBefore(TimeSlot other)
Checks if this date range starts before the given date range.
|
boolean |
strictlyIncludes(TimeSlot other)
Checks if this time slot strictly includes the given time slot.
|
public TimeSlotImpl(LocalDateTime start, LocalDateTime finish)
start - the start of the time slot where the condition start <= end
must be truefinish - the end of the time slotpublic LocalDateTime getFinish()
public LocalDateTime getStart()
public boolean isEmpty()
public boolean includes(LocalDateTime dateTime)
public boolean includes(TimeSlot other)
public boolean overlaps(TimeSlot other)
public boolean equals(Object other)
public int hashCode()
public int compareTo(TimeSlot other)
TimeSlotcompareTo in interface TimeSlotcompareTo in interface Comparable<TimeSlot>other - another time slotComparable.compareTo(java.lang.Object)public boolean startsBefore(TimeSlot other)
TimeSlotstartsBefore in interface TimeSlotother - the given date rangepublic boolean startsAfter(TimeSlot other)
TimeSlotstartsAfter in interface TimeSlotother - the given time slotpublic boolean endsBefore(TimeSlot other)
TimeSlotendsBefore in interface TimeSlotother - the given time slotpublic boolean endsAfter(TimeSlot other)
TimeSlotpublic boolean strictlyIncludes(TimeSlot other)
TimeSlotstrictlyIncludes in interface TimeSlotother - the given time slotpublic boolean exactlyMatches(TimeSlot other)
TimeSlotexactlyMatches in interface TimeSlotother - the given time slot.Copyright © 2016 BFH. All rights reserved.