Interface Zones<Z extends Zone>

    • Method Detail

      • register

        Zone register​(Z zone)
        Add zone to the internal container. Use carefully to avoid issues with internal contiguous ids
        Parameters:
        zone - the zone to be added
        Returns:
        the zone added
      • registerNew

        Z registerNew()
        Create and register new zone
        Returns:
        the new zone created
      • get

        Zone get​(long id)
        Retrieve zone by its Id
        Parameters:
        id - the id of the zone
        Returns:
        zone the zone retrieved
      • size

        int size()
        Collect number of zones
        Returns:
        the number of zones
      • isEmpty

        default boolean isEmpty()
        check if no zones are registered, i.e., size=0
        Returns:
        true when empty, false otherwise
      • getNumberOfCentroids

        default int getNumberOfCentroids()
        each zone has exactly one centroid, so this is functionally equivalent to calling size()
        Returns:
        number of centroids