Class LocationList.Builder

  • Enclosing interface:
    LocationList

    public static final class LocationList.Builder
    extends Object
    A reusable LocationList builder. Repeat calls to build() will return multiple lists in series with each new list containing all the elements of the one before it. Builder does not permit the addition of null elements, however, null checking is lazy and not performed until build() is called.

    Use LocationList.builder() to create new builder instances.

    • Method Detail

      • add

        public LocationList.Builder add​(double longitude,
                                        double latitude)
        Add a location with the specified longitude and latitude, and a depth of 0 km.
        Parameters:
        longitude - in decimal degrees
        latitude - in decimal degrees
        Returns:
        this Builder
        Throws:
        IllegalArgumentException - if any values are out of range
        See Also:
        Coordinates
      • add

        public LocationList.Builder add​(double longitude,
                                        double latitude,
                                        double depth)
        Add a location with the specified longitude, latitude, and depth.
        Parameters:
        longitude - in decimal degrees
        latitude - in decimal degrees
        depth - in km (positive down)
        Returns:
        this Builder
        Throws:
        IllegalArgumentException - if any values are out of range
        See Also:
        Coordinates
      • add

        public LocationList.Builder add​(Location... locations)
        Add each of the supplied locations.
        Parameters:
        locations - to add
        Returns:
        this Builder