Package org.javarosa.core.model.data
Interface IAnswerData
- All Superinterfaces:
Externalizable
- All Known Implementing Classes:
BooleanData,DateData,DateTimeData,DecimalData,GeoPointData,GeoShapeData,GeoTraceData,IntegerData,LongData,MultipleItemsData,MultiPointerAnswerData,PointerAnswerData,SelectMultiData,SelectOneData,StringData,TimeData,UncastData
public interface IAnswerData extends Externalizable
An IAnswerData object represents an answer to a question
posed to a user.
IAnswerData objects should never in any circumstances contain
a null data value. In cases of empty or non-existent responses,
the IAnswerData reference should itself be null.
- Author:
- Drew Roos
-
Method Summary
Modifier and Type Method Description IAnswerDatacast(UncastData data)Casts the provided data into this data type.IAnswerDataclone()StringgetDisplayText()ObjectgetValue()voidsetValue(Object o)UncastDatauncast()Data types can be uncast if they are expected to be used in different contexts.Methods inherited from interface org.javarosa.core.util.externalizable.Externalizable
readExternal, writeExternal
-
Method Details
-
setValue
- Parameters:
o- the value of this answerdata object. Cannot be null. Null Data will not overwrite existing values.- Throws:
NullPointerException- if o is null
-
getValue
Object getValue()- Returns:
- The value of this answer, will never be null
-
getDisplayText
String getDisplayText()- Returns:
- Gets a string representation of this answer
-
clone
IAnswerData clone() -
uncast
UncastData uncast()Data 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.- Returns:
- An uncast representation of this answer which can be used in a different context.
-
cast
Casts the provided data into this data type.- 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
-