com.dlsc.flexgantt.policy.dateline

## Class AbstractZoomPolicy<T extends IGranularity>

- java.lang.Object
- - com.dlsc.flexgantt.policy.AbstractPolicy
  - - com.dlsc.flexgantt.policy.dateline.AbstractZoomPolicy<T>

- Type Parameters:
    `T` - the type of the granularities
  All Implemented Interfaces:
    IZoomPolicy<T>, IPolicy
  Direct Known Subclasses:
    SimpleGranularityZoomPolicy, TimeGranularityZoomPolicy

      public abstract class AbstractZoomPolicy<T extends IGranularity>
      extends AbstractPolicy
      implements IZoomPolicy<T>

  An abstract zoom policy implementation, which allows to specify a list of supported granularities. The type of the granularities gets specified by the subclasses.
  Since:
    1.0
  Version:
    $Revision: 1.8 $
  Author:
    Dirk Lemmermann

- - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `AbstractZoomPolicy(T[] granularities)` Constructs a new zoom policy.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `T` | `getGranularity(int index)` Returns the granularity with the given index.
    `int` | `getGranularityCount()` Returns the number of supported granularities.
    `int` | `getGranularityIndex(T granularity)` Returns the index of the given granularity.
    `void` | `setGranularities(T[] granularities)` Sets the list of supported granularities.

    - ### 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`

- - ### Constructor Detail

    - #### AbstractZoomPolicy

          protected AbstractZoomPolicy(T[] granularities)

      Constructs a new zoom policy.
      Parameters:
        `granularities` - the granularities that are supported by the zoom policy
      Since:
        1.0

  - ### Method Detail

    - #### setGranularities

          public void setGranularities(T[] granularities)

      Sets the list of supported granularities.
      Parameters:
        `granularities` - the list of supported granularities (granularities that will be shown in the dateline)
      Since:
        1.0

    - #### getGranularity

          public T getGranularity(int index)

      Description copied from interface: `IZoomPolicy`
      Returns the granularity with the given index.
      Specified by:
        `getGranularity` in interface `IZoomPolicy<T extends IGranularity>`
      Parameters:
        `index` - the index for which to return a granularity
      Returns:
        the granularity with the given index

    - #### getGranularityCount

          public int getGranularityCount()

      Description copied from interface: `IZoomPolicy`
      Returns the number of supported granularities.
      Specified by:
        `getGranularityCount` in interface `IZoomPolicy<T extends IGranularity>`
      Returns:
        the list of supported granularities (granularities that will be shown in the dateline)

    - #### getGranularityIndex

          public int getGranularityIndex(T granularity)

      Description copied from interface: `IZoomPolicy`
      Returns the index of the given granularity.
      Specified by:
        `getGranularityIndex` in interface `IZoomPolicy<T extends IGranularity>`
      Parameters:
        `granularity` - the granularity for which to return an index
      Returns:
        the granularity index

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