Package org.javarosa.core.model.data
Class GeoPointData
java.lang.Object
org.javarosa.core.model.data.GeoPointData
- All Implemented Interfaces:
IAnswerData,Externalizable,IExprDataType
public class GeoPointData extends Object implements IAnswerData, IExprDataType
A response to a question requesting an GeoPoint Value.
Ensure that any missing values are reset to MISSING_VALUE
This is currently 0.0, but perhaps should be NaN?
An uninitialized GeoPoint is:
[0.0, 0.0, MISSING_VALUE, MISSING_VALUE]
- Author:
- mitchellsundt@gmail.com, Yaw Anokwa
-
Field Summary
Fields Modifier and Type Field Description static doubleMISSING_VALUEstatic doubleNO_ACCURACY_VALUEstatic intREQUIRED_ARRAY_SIZE -
Constructor Summary
Constructors Constructor Description GeoPointData()Empty Constructor, necessary for dynamic construction during deserialization.GeoPointData(double[] gp)GeoPointData(GeoPointData gpd) -
Method Summary
Modifier and Type Method Description GeoPointDatacast(UncastData data)Casts the provided data into this data type.IAnswerDataclone()StringgetDisplayText()doublegetPart(int i)ObjectgetValue()voidreadExternal(DataInputStream in, PrototypeFactory pf)voidsetValue(Object o)BooleantoBoolean()DoubletoNumeric()StringtoString()UncastDatauncast()Data types can be uncast if they are expected to be used in different contexts.voidwriteExternal(DataOutputStream out)
-
Field Details
-
REQUIRED_ARRAY_SIZE
public static final int REQUIRED_ARRAY_SIZE- See Also:
- Constant Field Values
-
MISSING_VALUE
public static final double MISSING_VALUE- See Also:
- Constant Field Values
-
NO_ACCURACY_VALUE
public static final double NO_ACCURACY_VALUE- See Also:
- Constant Field Values
-
-
Constructor Details
-
GeoPointData
public GeoPointData()Empty Constructor, necessary for dynamic construction during deserialization. Shouldn't be used otherwise. -
GeoPointData
-
GeoPointData
public GeoPointData(double[] gp)
-
-
Method Details
-
clone
- Specified by:
clonein interfaceIAnswerData- Overrides:
clonein classObject
-
getDisplayText
- Specified by:
getDisplayTextin interfaceIAnswerData- Returns:
- Gets a string representation of this answer
-
getValue
- Specified by:
getValuein interfaceIAnswerData- Returns:
- The value of this answer, will never be null
-
setValue
- Specified by:
setValuein interfaceIAnswerData- Parameters:
o- the value of this answerdata object. Cannot be null. Null Data will not overwrite existing values.
-
readExternal
- Specified by:
readExternalin interfaceExternalizable- Throws:
IOException
-
writeExternal
- Specified by:
writeExternalin interfaceExternalizable- Throws:
IOException
-
uncast
Description copied from interface:IAnswerDataData types can be uncast if they are expected to be used in different contexts. This allows, for instance, select values to be generated by casting other types or vic-a-versa.- Specified by:
uncastin interfaceIAnswerData- Returns:
- An uncast representation of this answer which can be used in a different context.
-
cast
Description copied from interface:IAnswerDataCasts the provided data into this data type.- Specified by:
castin interfaceIAnswerData- Parameters:
data- An uncast data value which is compatible with this data type- Returns:
- An instance of the instance's data type which contains that value
- Throws:
IllegalArgumentException- If the uncast data is not in a compatible format
-
toBoolean
- Specified by:
toBooleanin interfaceIExprDataType
-
toNumeric
- Specified by:
toNumericin interfaceIExprDataType
-
toString
- Specified by:
toStringin interfaceIExprDataType- Overrides:
toStringin classObject
-
getPart
public double getPart(int i)
-