|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.askgeo.dbl.base.ResultBase
public abstract class ResultBase
The base class of all result classes. Each subclass of GeneralMap has a companion result class that is itself a subclass of ResultBase. Those result classes are what are returned when a map is queried.
Maps may be configured so that if a given query point does not lie inside any of the shapes in the map, then it will snap to a nearby shape if it is within a specified distance of the query point. The getIsInside method return whether the query point was inside the shape or not, and the getMinDistanceKm method returns the distance from the query point to the shape in kilometers (or zero if it is inside the shape).
Constructor Summary | |
---|---|
ResultBase(int askGeoId,
boolean isInside,
double minDistanceKm,
java.lang.String[] fields,
PolygonData polygonData)
|
Method Summary | |
---|---|
int |
getAskGeoId()
Within each map, every shape has a unique integer ID. |
java.lang.String |
getDataField(DataFieldInterface e)
Each map has metadata associated with each shape. |
boolean |
getIsInside()
Query points that are not within any of the shapes in the map will snap-to the nearest shape if that shape is within a specified snap-to radius. |
double |
getMinDistanceKm()
Query points that are not within any of the shapes in the map will snap-to the nearest shape if that shape is within a specified snap-to radius. |
PolygonData |
getPolygonData()
Returns the polygon data for the shape from which this result was built |
java.lang.String |
getResultField(DataFieldInterface f)
The AskGeo ID, the isInside boolean, and the minDistanceKm may be accessed by the direct accessors getAskGeoId, getIsInside, and getMinDistanceKm. |
double |
parseDoubleOrNan(java.lang.String text)
All data fields are stored as strings but many are more useful as numbers. |
int |
parseIntOrElse(java.lang.String text,
int alt)
All data fields are stored as strings but many are more useful as numbers. |
java.lang.String |
toString()
The string representation of a result is a tab-separated concatenation of all the data fields. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ResultBase(int askGeoId, boolean isInside, double minDistanceKm, java.lang.String[] fields, PolygonData polygonData)
Method Detail |
---|
public java.lang.String toString()
toString
in class java.lang.Object
public PolygonData getPolygonData()
public int getAskGeoId()
public boolean getIsInside()
public double getMinDistanceKm()
public java.lang.String getResultField(DataFieldInterface f)
f
- is a ResultField enum value (either ResultField.AskGeoId, ResultField.IsInside, or
ResultField.MinDistanceKm).
public java.lang.String getDataField(DataFieldInterface e)
e
- is a DataField enum value from the public inner enum within the map class from which this result was
generated.
public double parseDoubleOrNan(java.lang.String text)
text
- the string representation of a double.
public int parseIntOrElse(java.lang.String text, int alt)
alt
is returned.
text
- the string representation of a double.alt
- the integer to return if the parsing fails.
alt
if the parsing fails.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |