public class OpeningHours extends AbstractDutyHours implements IOpeningHours
INode
can be given service by IResource
.
Giving service to a Node
outside of the OpeningHours
will trigger a IViolation
and will produce additional costs.IDutyHours.DutyHoursFlavour
Constructor and Description |
---|
OpeningHours(GregorianCalendar hoursBegin,
GregorianCalendar hoursEnd)
Deprecated.
please use
OpeningHours(ZonedDateTime, ZonedDateTime) with updated attributes |
OpeningHours(Instant hoursBegin,
Instant hoursEnd)
Deprecated.
please use
OpeningHours(ZonedDateTime, ZonedDateTime) with updated attributes |
OpeningHours(Instant hoursBegin,
Instant hoursEnd,
ZoneId zoneId)
Constructor of
OpeningHours using Instants . |
OpeningHours(LocalDateTime hoursBegin,
LocalDateTime hoursEnd)
Deprecated.
please use
OpeningHours(ZonedDateTime, ZonedDateTime) with updated attributes |
OpeningHours(long hoursBeginMillis,
long hoursEndMillis)
Deprecated.
please use
OpeningHours(ZonedDateTime, ZonedDateTime) with updated attributes |
OpeningHours(com.google.common.collect.Range<Instant> interval)
Deprecated.
please use
OpeningHours(ZonedDateTime, ZonedDateTime) with updated attributes |
OpeningHours(TimeWindow window) |
OpeningHours(TimeWindow access,
List<TimeWindow> services) |
OpeningHours(TimeWindow access,
TimeWindow service) |
OpeningHours(ZonedDateTime hoursBegin,
ZonedDateTime hoursEnd)
This constructor sets the
OpeningHours for the INode . |
OpeningHours(ZonedDateTime accessHoursBegin,
ZonedDateTime accessHoursEnd,
boolean isSoloAccessHour) |
Modifier and Type | Method and Description |
---|---|
IOpeningHours |
copy()
Returns the hours as
WorkingHours(this.getBegin(), this.getEnd(), this.getZoneId()) or
OpeningHours(this.getBegin(), this.getEnd(), this.getZoneId()) . |
IDutyHours.DutyHoursFlavour |
getFlavour()
Gets the
IDutyHours.DutyHoursFlavour.WOH_FLAVOUR , the default value is enum constant
ordinal: 0 . |
List<org.apache.commons.lang3.tuple.Pair<Long,Long>> |
getServiceHoursOffsets() |
boolean |
isSoloAccessHour() |
void |
setIsSoloAccessHour(boolean isSoloAccessHour) |
void |
setServiceHoursOffsets(List<org.apache.commons.lang3.tuple.Pair<Long,Long>> offsets) |
static IOpeningHours |
takeOverProperties(IOpeningHours src,
IOpeningHours target) |
compareTo, getTimeWindow, isPrefferedHour, setIsPrefferedHour, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getTimeWindow, isPrefferedHour, setIsPrefferedHour
compareTo
@Deprecated public OpeningHours(GregorianCalendar hoursBegin, GregorianCalendar hoursEnd)
OpeningHours(ZonedDateTime, ZonedDateTime)
with updated attributeshoursBegin
- hoursBeginhoursEnd
- hoursEnd@Deprecated public OpeningHours(LocalDateTime hoursBegin, LocalDateTime hoursEnd)
OpeningHours(ZonedDateTime, ZonedDateTime)
with updated attributeshoursBegin
- hoursBeginhoursEnd
- hoursEndpublic OpeningHours(ZonedDateTime hoursBegin, ZonedDateTime hoursEnd)
OpeningHours
for the INode
. The first
set of parameters specify when the Node
opens and closes.
Giving service to a Node
outside of the OpeningHours
will trigger a IViolation
and will produce additional costs.
Example:
private void addNodes() {
List<IOpeningHours> weeklyOpeningHours = new ArrayList<IOpeningHours>();
weeklyOpeningHours.add(
new OpeningHours(
ZonedDateTime.of(2020, MAY.getValue(), 6, 8, 0, 0, 0, ZoneId.of("Europe/Berlin")),
ZonedDateTime.of(2020, MAY.getValue(), 6, 17, 0, 0, 0, ZoneId.of("Europe/Berlin"))));
weeklyOpeningHours.add(
new OpeningHours(
ZonedDateTime.of(2020, MAY.getValue(), 7, 8, 0, 0, 0, ZoneId.of("Europe/Berlin")),
ZonedDateTime.of(2020, MAY.getValue(), 7, 17, 0, 0, 0, ZoneId.of("Europe/Berlin"))));
Duration visitDuration = Duration.ofMinutes(20);
// Defining a Node
TimeWindowGeoNode aachen =
new TimeWindowGeoNode("Aachen", 50.775346, 6.083887, weeklyOpeningHours, visitDuration, 1);
this.addElement(aachen);
}
hoursBegin
- the zonedDateTime when the WorkingHours of the Node startshoursEnd
- the zonedDateTime when the WorkingHors of the Node endpublic OpeningHours(TimeWindow window)
public OpeningHours(TimeWindow access, TimeWindow service)
public OpeningHours(TimeWindow access, List<TimeWindow> services)
public OpeningHours(ZonedDateTime accessHoursBegin, ZonedDateTime accessHoursEnd, boolean isSoloAccessHour)
@Deprecated public OpeningHours(Instant hoursBegin, Instant hoursEnd)
OpeningHours(ZonedDateTime, ZonedDateTime)
with updated attributeshoursBegin
- hoursBeginhoursEnd
- hoursEndpublic OpeningHours(Instant hoursBegin, Instant hoursEnd, ZoneId zoneId)
OpeningHours
using Instants
. The first set of parameters
specify when the Node
opens and closes. Giving service to a Node
outside of
the OpeningHours
will trigger a IViolation
and will produce additional costs.hoursBegin
- the instant begin of the opening hourshoursEnd
- the instant end of the opening hourszoneId
- the zone ID of the beginning and closing times@Deprecated public OpeningHours(com.google.common.collect.Range<Instant> interval)
OpeningHours(ZonedDateTime, ZonedDateTime)
with updated attributesinterval
- interval@Deprecated public OpeningHours(long hoursBeginMillis, long hoursEndMillis)
OpeningHours(ZonedDateTime, ZonedDateTime)
with updated attributeshoursBeginMillis
- hoursBeginMillishoursEndMillis
- hoursEndMillispublic void setServiceHoursOffsets(List<org.apache.commons.lang3.tuple.Pair<Long,Long>> offsets)
public List<org.apache.commons.lang3.tuple.Pair<Long,Long>> getServiceHoursOffsets()
getServiceHoursOffsets
in interface IOpeningHours
public boolean isSoloAccessHour()
isSoloAccessHour
in interface IOpeningHours
public void setIsSoloAccessHour(boolean isSoloAccessHour)
public IDutyHours.DutyHoursFlavour getFlavour()
IDutyHours
IDutyHours.DutyHoursFlavour.WOH_FLAVOUR
, the default value is enum constant
ordinal: 0
.getFlavour
in interface IDutyHours
public static IOpeningHours takeOverProperties(IOpeningHours src, IOpeningHours target)
public IOpeningHours copy()
IDutyHours
WorkingHours(this.getBegin(), this.getEnd(), this.getZoneId())
or
OpeningHours(this.getBegin(), this.getEnd(), this.getZoneId())
. Further, properties are copied.copy
in interface IDutyHours
Copyright © 2017–2023 DNA Evolutions GmbH. All rights reserved.