public class PeerLocation
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
double |
getClosestPeerLocation(double l,
java.util.Set<java.lang.Double> exclude)
Finds the closest non-excluded peer in O(log n + m) time, where n is the number of peers and
m the number of exclusions.
|
int |
getDegree() |
double |
getLocation() |
long |
getLocationSetTime() |
double[] |
getPeersLocationArray()
Returns an array copy of locations of our peer's peers, or null if we don't have them.
|
boolean |
isValidLocation() |
void |
setPeerLocations(java.lang.String[] peerLocationsString)
Should only be called in the constructor
|
java.lang.String |
toString() |
public java.lang.String toString()
toString in class java.lang.Objectpublic void setPeerLocations(java.lang.String[] peerLocationsString)
public double getLocation()
public double[] getPeersLocationArray()
public long getLocationSetTime()
public boolean isValidLocation()
public int getDegree()
public double getClosestPeerLocation(double l,
java.util.Set<java.lang.Double> exclude)
exclude - the set of locations to exclude, may be null