[Canonical page](<https://docs.dhtmlx.com/planning-engine/java/api/project/analyze-options/>)
[Full documentation index](<https://docs.dhtmlx.com/planning-engine/llms.txt>)


# AnalyzeOptions

Options for [`Project#analyze`](<https://docs.dhtmlx.com/planning-engine/java/api/project-analyze.md>). They select which analytics the returned [`ScheduleResult`](<https://docs.dhtmlx.com/planning-engine/java/api/results/schedule-result.md>) carries. `new AnalyzeOptions()` requests no analytics.

## Declaration

```java
public class AnalyzeOptions extends ValueRecord implements DeepCloneable<AnalyzeOptions>
```

Set the field with the fluent setter: `new AnalyzeOptions().withAnalytics(new AnalyticsOptions().withSlack(true))`.

## Constructors

### AnalyzeOptions()

```java
public AnalyzeOptions()
```

Creates options with `analytics` at its default.

## Fields

| Field | Type | Default | Description |
|---|---|---|---|
| `analytics` | [`AnalyticsOptions`](<https://docs.dhtmlx.com/planning-engine/java/api/project/analytics-options.md>) | `new AnalyticsOptions()` (no analytics) | Requests critical path and slack. Fills [`ScheduleResult.analytics`](<https://docs.dhtmlx.com/planning-engine/java/api/results/schedule-result.md>). |

### analytics

```java
public AnalyticsOptions analytics = new AnalyticsOptions();
```

Turns on [`AnalyticsOptions.slack`](<https://docs.dhtmlx.com/planning-engine/java/api/project/analytics-options.md>) and [`AnalyticsOptions.criticalPath`](<https://docs.dhtmlx.com/planning-engine/java/api/project/analytics-options.md>). With both flags `false` (the default), `ScheduleResult.analytics` is `null`. With either flag set, it holds an [`Analytics`](<https://docs.dhtmlx.com/planning-engine/java/api/results/analytics.md>) value. Check its status before reading the data.

## Methods

### withAnalytics

```java
public AnalyzeOptions withAnalytics(AnalyticsOptions value)
```

Assigns `analytics` and returns this instance for chaining.

**Returns** - this `AnalyzeOptions`.

### deepClone

```java
public AnalyzeOptions deepClone()
```

Returns a copy that doesn't share the `analytics` object with this instance.

**Returns** - a new `AnalyzeOptions` with the same values.

### copy

```java
public AnalyzeOptions copy()
```

Returns a shallow copy. The copy shares the `analytics` object with this instance.

**Returns** - a new `AnalyzeOptions` with the same field value.

### equals, hashCode, toString

```java
public boolean equals(Object other)
public int hashCode()
public String toString()
```

Inherited from [`ValueRecord`](<https://docs.dhtmlx.com/planning-engine/java/api/support/value-record.md>). Two `AnalyzeOptions` are equal when their `analytics` values are equal. `toString()` lists the field.

## Example

```java
import java.util.List;
import org.dhtmlx.plen.*;

public class AnalyzeOptionsExample {
  public static void main(String[] args) throws Exception {
    ProjectData data = new ProjectData()
        .withTasks(List.of(
            new TaskData(Id.str("design"))
                .withStartDate(Moment.fromYmdHm(2026, 1, 5, 8, 0))
                .withDuration(2.0),
            new TaskData(Id.str("build"))
                .withStartDate(Moment.fromYmdHm(2026, 1, 7, 8, 0))
                .withDuration(3.0)))
        .withLinks(List.of(new LinkData()
            .withId(Id.str("l1"))
            .withSource(Id.str("design"))
            .withTarget(Id.str("build"))));

    AnalyzeOptions options = new AnalyzeOptions()
        .withAnalytics(new AnalyticsOptions().withSlack(true).withCriticalPath(true));

    ScheduleResult result = new Project().analyze(data, options);
    System.out.println(result.analytics);
  }
}
```

## Related

- [`Project#analyze`](<https://docs.dhtmlx.com/planning-engine/java/api/project-analyze.md>) - the call that takes it
- [`AnalyticsOptions`](<https://docs.dhtmlx.com/planning-engine/java/api/project/analytics-options.md>) - the slack and critical path switches
- [`ScheduleResult`](<https://docs.dhtmlx.com/planning-engine/java/api/results/schedule-result.md>) - the result it shapes
- [Analyzing without scheduling](<https://docs.dhtmlx.com/planning-engine/java/scheduling/critical-path-and-slack.md#analyzing-without-scheduling>) - analytics over supplied or current dates
