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 and ProfileQuery.basis, and LoadProfile.basis reports the basis a profile was built with.

Declaration#

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, 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: DAY for TimeUnit.DAY, HOUR for TimeUnit.HOUR and TimeUnit.MINUTE.

Example#

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
    }
}