Class ListZoomContext

  • All Implemented Interfaces:
    ZoomContext

    public class ListZoomContext
    extends MedialZoomContext
    A zoom context specified by an explicit list of scale denominators.
    Author:
    Kevin Smith, Boundless
    • Constructor Summary

      Constructors 
      Constructor Description
      ListZoomContext​(List<Double> scales)  
      ListZoomContext​(List<Double> scales, int initial)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      double getMedialScale​(int level)
      Get a scale between the given zoom level and the next
      double getScaleDenominator​(int level)
      Find the reciprocal of the scale at a specified zoom level in this context.
      boolean isInRange​(int level)
      Is the given level within the range for which the context has clearly defined scales.
      static void validate​(List<Double> scales)
      Checks if the list contains a decreasing sequence of finite, positive, non-null values.
      • Methods inherited from class Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ListZoomContext

        public ListZoomContext​(List<Double> scales,
                               int initial)
      • ListZoomContext

        public ListZoomContext​(List<Double> scales)
    • Method Detail

      • validate

        public static void validate​(List<Double> scales)
        Checks if the list contains a decreasing sequence of finite, positive, non-null values.
        Throws:
        IllegalArgumentException - if the values are not decreasing, positive, and finite.
        NullPointerException - if any values are null.
      • getScaleDenominator

        public double getScaleDenominator​(int level)
        Description copied from interface: ZoomContext
        Find the reciprocal of the scale at a specified zoom level in this context.
        Parameters:
        level - The level
        Returns:
        The scale denominator
      • isInRange

        public boolean isInRange​(int level)
        Description copied from interface: ZoomContext
        Is the given level within the range for which the context has clearly defined scales.