com.dlsc.flexgantt.policy.layer

## Class AbstractGridPolicy<T extends IGranularity>

- java.lang.Object
- - com.dlsc.flexgantt.policy.AbstractPolicy
  - - com.dlsc.flexgantt.policy.layer.AbstractGridPolicy<T>

- Type Parameters:
    `T` - the type of the grid granularity
  All Implemented Interfaces:
    IPolicy, IGridPolicy<T>
  Direct Known Subclasses:
    SimpleGranularityGridPolicy, TimeGranularityGridPolicy

      public abstract class AbstractGridPolicy<T extends IGranularity>
      extends AbstractPolicy
      implements IGridPolicy<T>

  An abstract implementation of `IGridPolicy`, which deals with storing the list of supported granularities.
  Since:
    1.0
  Version:
    $Revision: 1.8 $
  Author:
    Dirk Lemmermann

- - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `AbstractGridPolicy(boolean adjustingStartTimes, boolean adjustingEndTimes, T... granularities)` Constructs a new grid policy.
    `protected` | `AbstractGridPolicy(T... granularities)` Constructs a new grid policy, which adjusts start and end times.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `T[]` | `getGridGranularities()` Returns the granularities that will be available for the grid.
    `boolean` | `isAdjustingEndTimes()` Determines whether the policy will round end times based on a given granularity.
    `boolean` | `isAdjustingStartTimes()` Determines whether the policy will round start times based on a given granularity.

    - ### Methods inherited from class com.dlsc.flexgantt.policy.AbstractPolicy

      `assertClass`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface com.dlsc.flexgantt.policy.layer.IGridPolicy

      `getGridAdjustedEndTime, getGridAdjustedStartTime, getGridAdjustedTimeSpan`

- - ### Constructor Detail

    - #### AbstractGridPolicy

          protected AbstractGridPolicy(boolean adjustingStartTimes,
                                       boolean adjustingEndTimes,
                                       T... granularities)

      Constructs a new grid policy.
      Parameters:
        `adjustingStartTimes` - if TRUE the start times will be rounded based on the given grid granularity
        `adjustingEndTimes` - if TRUE the end times will be rounded based on the given grid granularity
        `granularities` - the supported grid granularities
      Since:
        1.0

    - #### AbstractGridPolicy

          protected AbstractGridPolicy(T... granularities)

      Constructs a new grid policy, which adjusts start and end times.
      Parameters:
        `granularities` - the supported grid granularities
      Since:
        1.0

  - ### Method Detail

    - #### getGridGranularities

          public T[] getGridGranularities()

      Description copied from interface: `IGridPolicy`
      Returns the granularities that will be available for the grid.
      Specified by:
        `getGridGranularities` in interface `IGridPolicy<T extends IGranularity>`
      Returns:
        the grid granularities

    - #### isAdjustingStartTimes

          public boolean isAdjustingStartTimes()

      Determines whether the policy will round start times based on a given granularity.
      Returns:
        TRUE if the policy does round start times
      Since:
        1.0

    - #### isAdjustingEndTimes

          public boolean isAdjustingEndTimes()

      Determines whether the policy will round end times based on a given granularity.
      Returns:
        TRUE if the policy does round end times
      Since:
        1.0

Copyright © 2006–2020 Dirk Lemmermann Software & Consulting. All rights reserved.