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


# Basis

The size of the time buckets in which resource load is measured and compared with capacity: one hour or one day. It's the type of [`LevelingOptions.basis`](<https://docs.dhtmlx.com/planning-engine/java/api/resources/leveling-options.md#basis>) and [`ProfileQuery.basis`](<https://docs.dhtmlx.com/planning-engine/java/api/resources/profile-query.md>), and [`LoadProfile.basis`](<https://docs.dhtmlx.com/planning-engine/java/api/resources/load-profile.md>) reports the basis a profile was built with.

## Declaration

```java
package org.dhtmlx.plen;

public enum Basis {
    HOUR,
    DAY
}
```

`Basis` is a plain Java enum, so `values()`, `valueOf(String)` and `name()` work as usual. `valueOf` takes the constant name (`"DAY"`). In the [JSON API](<https://docs.dhtmlx.com/planning-engine/java/api/json/overview.md>), the values are spelled `"hour"` and `"day"`.

## Values

| Value | Description |
|---|---|
| `HOUR` | Load is measured per one-hour bucket. |
| `DAY` | Load is measured per day bucket, from 00:00 to the next 00:00. |

Minute, week and month buckets aren't supported.

When an options field of type `Basis` is left `null`, the basis is derived from the project's [`SchedulingConfig.durationUnit`](<https://docs.dhtmlx.com/planning-engine/java/api/data/scheduling-config.md>): `DAY` for [`TimeUnit.DAY`](<https://docs.dhtmlx.com/planning-engine/java/api/data/time-unit.md>), `HOUR` for `TimeUnit.HOUR` and `TimeUnit.MINUTE`.

## Example

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

public class BasisExample {
    public static void main(String[] args) throws Exception {
        LevelingOptions options = new LevelingOptions().withBasis(Basis.DAY);
        System.out.println(options.basis);           // DAY

        Basis parsed = Basis.valueOf("HOUR");
        System.out.println(parsed == Basis.HOUR);    // true
    }
}
```

## Related

- [`LevelingOptions`](<https://docs.dhtmlx.com/planning-engine/java/api/resources/leveling-options.md>) - the leveling basis
- [`ProfileQuery`](<https://docs.dhtmlx.com/planning-engine/java/api/resources/profile-query.md>) - the load-profile basis
- [`TimeUnit`](<https://docs.dhtmlx.com/planning-engine/java/api/data/time-unit.md>) - the duration unit a null basis follows
- [Leveling options](<https://docs.dhtmlx.com/planning-engine/java/resources-and-assignment/leveling-resources.md#leveling-options>) - choosing a basis for leveling
