AnalyticsOptions#
Selects which analytics a ScheduleResult carries. Create one with new AnalyticsOptions(), set flags with the fluent withX setters, and pass it as the analytics field of SolveOptions, PreviewOptions or AnalyzeOptions. Each of those fields defaults to new AnalyticsOptions(), which requests nothing.
Declaration#
Constructors#
AnalyticsOptions()#
public
Creates options with both flags false.
Fields#
| Field | Type | Default | Description |
|---|---|---|---|
slack |
boolean |
false |
true fills Analytics.slack with the total and free slack of each task. |
criticalPath |
boolean |
false |
true fills Analytics.criticalPath with the critical tasks and links. |
With both flags false, ScheduleResult.analytics is null. With either flag set, ScheduleResult.analytics is set, and a field whose flag is false stays null. Check Analytics.status before reading the fields.
Methods#
withSlack#
public AnalyticsOptions
Sets slack and returns this instance for chaining.
Parameters
| Name | Type | Description |
|---|---|---|
value |
boolean |
true to request slack |
Returns - this AnalyticsOptions.
withCriticalPath#
public AnalyticsOptions
Sets criticalPath and returns this instance for chaining.
Parameters
| Name | Type | Description |
|---|---|---|
value |
boolean |
true to request the critical path |
Returns - this AnalyticsOptions.
deepClone#
public AnalyticsOptions
Returns a copy with the same slack and criticalPath.
Returns - a new AnalyticsOptions.
copy#
public AnalyticsOptions
Returns a shallow copy. AnalyticsOptions holds only boolean fields, so the result is the same as deepClone().
Returns - a new AnalyticsOptions.
equals, hashCode, toString#
public boolean
public int
public String
Inherited from ValueRecord. Two AnalyticsOptions are equal when slack and criticalPath are equal. toString() lists the fields, e.g. AnalyticsOptions{slack=true, criticalPath=false}.
Example#
// `project` already holds solved data.
AnalyzeOptions options ;
Analytics analytics ;
Related#
Analytics- the slack and critical path it selectsSolveOptions- carries it for solve and schedulePreviewOptions- carries it for previewAnalyzeOptions- carries it for analyze- Critical path and slack - requesting and reading analytics