Spring Data Document

org.springframework.data.mongodb.core.geo
Class GeoResults<T>

java.lang.Object
  extended by org.springframework.data.mongodb.core.geo.GeoResults<T>
All Implemented Interfaces:
Iterable<GeoResult<T>>

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

Value object to capture GeoResults as well as the average distance they have.

Author:
Oliver Gierke

Constructor Summary
GeoResults(List<GeoResult<T>> results)
          Creates a new GeoResults instance manually calculating the average distance from the distance values of the given GeoResults.
GeoResults(List<GeoResult<T>> results, Distance averageDistance)
          Creates a new GeoResults instance from the given GeoResults and average distance.
GeoResults(List<GeoResult<T>> results, Metric metric)
           
 
Method Summary
 boolean equals(Object obj)
           
 Distance getAverageDistance()
          Returns the average distance of all GeoResults in this list.
 List<GeoResult<T>> getContent()
          Returns the actual
 int hashCode()
           
 Iterator<GeoResult<T>> iterator()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GeoResults

public GeoResults(List<GeoResult<T>> results)
Creates a new GeoResults instance manually calculating the average distance from the distance values of the given GeoResults.

Parameters:
results - must not be null.

GeoResults

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

GeoResults

public GeoResults(List<GeoResult<T>> results,
                  Distance averageDistance)
Creates a new GeoResults instance from the given GeoResults and average distance.

Parameters:
results - must not be null.
averageDistance -
Method Detail

getAverageDistance

public Distance getAverageDistance()
Returns the average distance of all GeoResults in this list.

Returns:
the averageDistance

iterator

public Iterator<GeoResult<T>> iterator()
Specified by:
iterator in interface Iterable<GeoResult<T>>

getContent

public List<GeoResult<T>> getContent()
Returns the actual

Returns:

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object

Spring Data Document

Copyright © 2012. All Rights Reserved.