org.springframework.data.geo

## Class GeoResults<T>

- java.lang.Object
- - org.springframework.data.geo.GeoResults<T>

All Implemented Interfaces:
  Serializable, Iterable<GeoResult<T>>

    public class GeoResults<T>
    extends Object
    implements Iterable<GeoResult<T>>, Serializable

Value object to capture `GeoResult`s as well as the average distance they have.

Since:
  1.8
Author:
  Oliver Gierke, Thomas Darimont
See Also:
  Serialized Form

### Constructor Summary

Constructors
Constructor and Description
`GeoResults(List<? extends GeoResult<T>> results)` Creates a new `GeoResults` instance manually calculating the average distance from the distance values of the given `GeoResult`s.
`GeoResults(List<? extends GeoResult<T>> results, Distance averageDistance)` Creates a new `GeoResults` instance from the given `GeoResult`s and average distance.
`GeoResults(List<? extends GeoResult<T>> results, Metric metric)` Creates a new `GeoResults` instance manually calculating the average distance in the given `Metric` from the distance values of the given `GeoResult`s.

### Method Summary

All Methods Instance Methods Concrete Methods
`boolean` `equals(Object o)`
`Distance` `getAverageDistance()` Returns the average distance of all `GeoResult`s in this list.
`List<GeoResult<T>>` `getContent()` Returns the actual content of the `GeoResults`.
`int` `hashCode()`
`Iterator<GeoResult<T>>` `iterator()`
`String` `toString()`

### Methods inherited from class java.lang.Object

`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

### Methods inherited from interface java.lang.Iterable

`forEach, spliterator`

### Constructor Detail

#### GeoResults

    public GeoResults(List<? extends GeoResult<T>> results)

Creates a new `GeoResults` instance manually calculating the average distance from the distance values of the given `GeoResult`s.

Parameters:
  `results` - must not be null.

#### GeoResults

    public GeoResults(List<? extends GeoResult<T>> results,
                      Metric metric)

Creates a new `GeoResults` instance manually calculating the average distance in the given `Metric` from the distance values of the given `GeoResult`s.

Parameters:
  `results` - must not be null.
  `metric` - must not be null.

#### GeoResults

    public GeoResults(List<? extends GeoResult<T>> results,
                      Distance averageDistance)

Creates a new `GeoResults` instance from the given `GeoResult`s and average distance.

Parameters:
  `results` - must not be null.
  `averageDistance` - must not be null.

### Method Detail

#### getAverageDistance

    public Distance getAverageDistance()

Returns the average distance of all `GeoResult`s in this list.

Returns:
  the averageDistance

#### getContent

    public List<GeoResult<T>> getContent()

Returns the actual content of the `GeoResults`.

Returns:

#### iterator

    public Iterator<GeoResult<T>> iterator()

Specified by:
  `iterator` in interface `Iterable<GeoResult<T>>`

#### equals

    public boolean equals(Object o)

Overrides:
  `equals` in class `Object`

#### hashCode

    public int hashCode()

Overrides:
  `hashCode` in class `Object`

#### toString

    public String toString()

Overrides:
  `toString` in class `Object`