Interface ReferenceableAxis<P>

    • Method Detail

      • getName

        String getName()
        Returns:
        The name of the axis.
      • getCoordinateValue

        P getCoordinateValue​(int index)
        Gets the coordinate value at the given index
        Parameters:
        index - The index of the required position on the axis. Must be within the axis' extent.
        Returns:
        the coordinate value at the given index
        Throws:
        IndexOutOfBoundsException - if the axis' extent does not contain this index.
      • getCoordinateValues

        List<P> getCoordinateValues()
        Gets all of the coordinate values of the axis
        Returns:
        A list of coordinate values
      • isAscending

        boolean isAscending()
        Returns true if the values on the axis are in ascending order according to their natural ordering.
      • wraps

        boolean wraps()
        Returns true if the values on the axis wrap around (e.g. longitude)
      • getCoordinateBounds

        Extent<P> getCoordinateBounds​(int index)
        Gets the coordinate bounds associated with the point at the given index. In some types of ReferenceableAxis, each point along the axis is associated with a range of positions, rather than a single infinitesimal position. This method returns this range.
        Parameters:
        index -
        Returns:
        the coordinate bounds associated with the point at the given index. Returns an Extent with low=high if the bounds are infinitesimal. Never returns null.
      • findIndexOf

        int findIndexOf​(P position)

        Finds the index along this axis that corresponds with the given position. Formally, this returns an index such that getCoordinateBounds(index).contains(position) returns true. Returns -1 if the given position is not associated with any axis index.

        If this is a longitude axis, this method will handle the case of longitude values wrapping, therefore values of -180 and +180 are treated as equivalent by this method, irrespective of the values in getCoordinateValue(int).

        Parameters:
        position -
        Returns:
        the index of the given coordinate value, or -1 if not found.
      • getCoordinateExtent

        Extent<P> getCoordinateExtent()
        Gets the extent encompassing all the positions on this axis. This will usually be given by the low value of the first set of coordinate bounds and the high value of the last set of coordinate bounds (but beware that values along the axis might decrease, not increase).
      • size

        int size()
        Returns:
        The extent of this axis. Indices within this axis will run from 0 to size() - 1