com.dlsc.flexgantt.model.dateline

## Interface IGranularity<T extends IGranularity>

- Type Parameters:
    `T` - the object type of the granularity
  All Known Implementing Classes:
    SimpleGranularity, TimeGranularity

      public interface IGranularity<T extends IGranularity>

  A granularity describes a time unit (e.g. "Hour", "Minute", ...).
  Since:
    1.0
  Version:
    $Revision: 1.8 $
  Author:
    Dirk Lemmermann

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `String` | `getName()` Returns the name of the granularity (e.g.
    `String` | `getSingularName()` Returns the singular name of the granularity (e.g.
    `long` | `getStandardDuration()` Returns the standard duration in milliseconds of the granularity, e.g.
    `boolean` | `isDisplayingMarkerType(MarkerType type)` Determines whether markers of the given type will be shown in the timeline.
    `boolean` | `isLarger(T granularity)` Determines whether the given granularity is larger than the given one.
    `boolean` | `isSmaller(T granularity)` Determines whether the granularity is smaller than the given one.

- - ### Method Detail

    - #### getName

          String getName()

      Returns the name of the granularity (e.g. "days", "months", ...).
      Returns:
        the name of the granularity
      Since:
        1.0

    - #### getSingularName

          String getSingularName()

      Returns the singular name of the granularity (e.g. "day" instead of "days").
      Returns:
        the name of the granularity
      Since:
        2.1

    - #### isSmaller

          boolean isSmaller(T granularity)

      Determines whether the granularity is smaller than the given one. A granularity is smaller if it represents a smaller time unit. Minutes are smaller than hours, seconds are smaller than minutes.
      Parameters:
        `granularity` - the granularity with which to perform the comparison
      Returns:
        TRUE if the granularity is smaller than the given one
      Since:
        1.0

    - #### isLarger

          boolean isLarger(T granularity)

      Determines whether the given granularity is larger than the given one. A granularity is larger if it represents a larger time unit. Hours are larger than minutes, days are larger than hours.
      Parameters:
        `granularity` - the granularity with which to perform the comparison
      Returns:
        TRUE if the granularity is larger than the given one
      Since:
        1.0

    - #### isDisplayingMarkerType

          boolean isDisplayingMarkerType(MarkerType type)

      Determines whether markers of the given type will be shown in the timeline. It often does not make sense to show markers once a certain granularity (e.g. "decades") gets reached because then douzends of markers will clutter the screen.
      Parameters:
        `type` - the type of marker to check
      Returns:
        TRUE if markers of the given type shall be displayed in the timeline
      Since:
        1.1

    - #### getStandardDuration

          long getStandardDuration()

      Returns the standard duration in milliseconds of the granularity, e.g. day = 24 hours * 60 minutes * 60 seconds * 1000;
      Returns:
        the standard duration of one unit of this granularity
      Since:
        2.1

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