当前位置: 首页>>代码示例>>Java>>正文


Java BooleanData类代码示例

本文整理汇总了Java中org.javarosa.core.model.data.BooleanData的典型用法代码示例。如果您正苦于以下问题:Java BooleanData类的具体用法?Java BooleanData怎么用?Java BooleanData使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


BooleanData类属于org.javarosa.core.model.data包,在下文中一共展示了BooleanData类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: classForDataType

import org.javarosa.core.model.data.BooleanData; //导入依赖的package包/类
/**
 * map xforms data types to the Class that represents that data in a FormInstance
 * @param dataType
 * @return
 */
public static Class classForDataType (int dataType) {
	switch (dataType) {
	case Constants.DATATYPE_NULL: return StringData.class;
	case Constants.DATATYPE_TEXT: return StringData.class;
	case Constants.DATATYPE_INTEGER: return IntegerData.class;
	case Constants.DATATYPE_LONG: return LongData.class;
	case Constants.DATATYPE_DECIMAL: return DecimalData.class;
	case Constants.DATATYPE_BOOLEAN: return BooleanData.class;
	case Constants.DATATYPE_DATE: return DateData.class;
	case Constants.DATATYPE_TIME: return TimeData.class;
	case Constants.DATATYPE_DATE_TIME: return DateTimeData.class;
	case Constants.DATATYPE_CHOICE: return SelectOneData.class;
	case Constants.DATATYPE_CHOICE_LIST: return SelectMultiData.class;
	case Constants.DATATYPE_GEOPOINT: return GeoPointData.class;
	case Constants.DATATYPE_GEOSHAPE: return GeoShapeData.class;
	case Constants.DATATYPE_GEOTRACE: return GeoTraceData.class;
	default: return null;
	}
}
 
开发者ID:medic,项目名称:javarosa,代码行数:25,代码来源:CompactInstanceWrapper.java

示例2: unpackValue

import org.javarosa.core.model.data.BooleanData; //导入依赖的package包/类
public static Object unpackValue (IAnswerData val) {
	if (val == null) {
		return "";
	} else if (val instanceof UncastData) {
		return val.getValue();
	} else if (val instanceof IntegerData) {
		return new Double(((Integer)val.getValue()).doubleValue());
	} else if (val instanceof LongData) {
		return new Double(((Long)val.getValue()).doubleValue());
	} else if (val instanceof DecimalData) {
		return val.getValue();
	} else if (val instanceof StringData) {
		return val.getValue();
	} else if (val instanceof SelectOneData) {
		return ((Selection)val.getValue()).getValue();
	} else if (val instanceof SelectMultiData) {
		return (new XFormAnswerDataSerializer()).serializeAnswerData(val);
	} else if (val instanceof DateData) {
		return val.getValue();
	} else if (val instanceof BooleanData) {
		return val.getValue();
	} else if (val instanceof GeoPointData) {
		// we have no access fns that interact with double[4] arrays (the getValue() data type)...
		return val.getDisplayText();
	} else if (val instanceof GeoShapeData) {
		// we have no access fns that interact with GeoShape objects (the getValue() data type)...
		return val.getDisplayText();
	} else if (val instanceof GeoTraceData) {
		// we have no access fns that interact with GeoTrace objects (the getValue() data type)...
		return val.getDisplayText();
	} else {
		System.out.println("warning: unrecognized data type in xpath expr: " + val.getClass().getName());
		return val.getValue(); //is this a good idea?
	}
}
 
开发者ID:medic,项目名称:javarosa,代码行数:36,代码来源:XPathPathExpr.java

示例3: serializeAnswerData

import org.javarosa.core.model.data.BooleanData; //导入依赖的package包/类
public Object serializeAnswerData(BooleanData data) {
	if(((Boolean)data.getValue()).booleanValue()) {
		return "1";
	} else {
		return "0";
	}
}
 
开发者ID:medic,项目名称:javarosa,代码行数:8,代码来源:XFormAnswerDataSerializer.java

示例4: unpackValue

import org.javarosa.core.model.data.BooleanData; //导入依赖的package包/类
public static Object unpackValue(IAnswerData val) {
    if (val == null) {
        return "";
    } else if (val instanceof UncastData) {
        return val.getValue();
    } else if (val instanceof IntegerData) {
        return new Double(((Integer)val.getValue()).doubleValue());
    } else if (val instanceof LongData) {
        return new Double(((Long)val.getValue()).doubleValue());
    } else if (val instanceof DecimalData) {
        return val.getValue();
    } else if (val instanceof StringData) {
        return val.getValue();
    } else if (val instanceof SelectOneData) {
        return ((Selection)val.getValue()).getValue();
    } else if (val instanceof SelectMultiData) {
        return (new XFormAnswerDataSerializer()).serializeAnswerData(val);
    } else if (val instanceof DateData) {
        return val.getValue();
    } else if (val instanceof DateTimeData) {
        return val.getValue();
    } else if (val instanceof BooleanData) {
        return val.getValue();
    } else if (val instanceof GeoPointData) {
        return val.uncast().getString();
    } else {
        System.out.println("warning: unrecognized data type in xpath expr: " + val.getClass().getName());

        //TODO: Does this mess up any of our other plans?
        return val.uncast().getString();
    }
}
 
开发者ID:dimagi,项目名称:commcare-j2me,代码行数:33,代码来源:XPathPathExpr.java

示例5: serializeAnswerData

import org.javarosa.core.model.data.BooleanData; //导入依赖的package包/类
public Object serializeAnswerData(BooleanData data) {
    if (((Boolean)data.getValue()).booleanValue()) {
        return "1";
    } else {
        return "0";
    }
}
 
开发者ID:dimagi,项目名称:commcare-j2me,代码行数:8,代码来源:XFormAnswerDataSerializer.java

示例6: unpackValue

import org.javarosa.core.model.data.BooleanData; //导入依赖的package包/类
public static Object unpackValue(IAnswerData val) {
    if (val == null) {
        return "";
    } else if (val instanceof UncastData) {
        return val.getValue();
    } else if (val instanceof IntegerData) {
        return ((Integer)val.getValue()).doubleValue();
    } else if (val instanceof LongData) {
        return ((Long)val.getValue()).doubleValue();
    } else if (val instanceof DecimalData) {
        return val.getValue();
    } else if (val instanceof StringData) {
        return val.getValue();
    } else if (val instanceof SelectOneData) {
        return ((Selection)val.getValue()).getValue();
    } else if (val instanceof SelectMultiData) {
        return (new XFormAnswerDataSerializer()).serializeAnswerData(val);
    } else if (val instanceof DateData) {
        return val.getValue();
    } else if (val instanceof DateTimeData) {
        return val.getValue();
    } else if (val instanceof BooleanData) {
        return val.getValue();
    } else if (val instanceof GeoPointData) {
        return val.uncast().getString();
    } else {
        System.out.println("warning: unrecognized data type in xpath expr: " + val.getClass().getName());

        //TODO: Does this mess up any of our other plans?
        return val.uncast().getString();
    }
}
 
开发者ID:dimagi,项目名称:commcare-core,代码行数:33,代码来源:XPathPathExpr.java

示例7: serializeAnswerData

import org.javarosa.core.model.data.BooleanData; //导入依赖的package包/类
public Object serializeAnswerData(BooleanData data) {
    if ((Boolean)data.getValue()) {
        return "1";
    } else {
        return "0";
    }
}
 
开发者ID:dimagi,项目名称:commcare-core,代码行数:8,代码来源:XFormAnswerDataSerializer.java


注:本文中的org.javarosa.core.model.data.BooleanData类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。