Class PiecewiseConstantSpecificDays
java.lang.Object
net.sourceforge.plantuml.project.ngm.math.AbstractPiecewiseConstant
net.sourceforge.plantuml.project.ngm.math.PiecewiseConstantSpecificDays
- All Implemented Interfaces:
PiecewiseConstant
Immutable implementation of
PiecewiseConstant that models a workload
pattern defined by specific dates.
Each specific LocalDate value is associated with a constant
Fraction representing the workload for that day (for example 3/10 for
30%). A zero value is meaningful and represents no allocation on that day.
For any date not explicitly mapped, a default value is returned.
-
Method Summary
Modifier and TypeMethodDescriptionCreates a PiecewiseConstantSpecificDays with the given default value.segmentAt(LocalDateTime instant, TimeDirection direction) (non-Javadoc)Returns a new PiecewiseConstantSpecificDays with the specified day associated with the given fraction.Methods inherited from class net.sourceforge.plantuml.project.ngm.math.AbstractPiecewiseConstant
iterateSegmentsFrom
-
Method Details
-
of
Creates a PiecewiseConstantSpecificDays with the given default value.- Parameters:
value- The default workload fraction.- Returns:
- A new PiecewiseConstantSpecificDays instance.
-
withDay
Returns a new PiecewiseConstantSpecificDays with the specified day associated with the given fraction.- Parameters:
day- The specific date to associate.value- The workload fraction for the specified date.- Returns:
- A new PiecewiseConstantSpecificDays instance with the updated mapping.
-
segmentAt
(non-Javadoc)- See Also:
-
net.sourceforge.plantuml.project.ngm.math.AbstractPiecewiseConstant#segmentAt(java.time.LocalDateTime)
-