• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java ExtUtil类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: equals

import org.javarosa.core.util.externalizable.ExtUtil; //导入依赖的package包/类
public boolean equals (Object o) {
	if (o instanceof XPathFuncExpr) {
		XPathFuncExpr x = (XPathFuncExpr)o;

		//Shortcuts for very easily comprable values
		//We also only return "True" for methods we expect to return the same thing. This is not good
		//practice in Java, since o.equals(o) will return false. We should evaluate that differently.
		//Dec 8, 2011 - Added "uuid", since we should never assume one uuid equals another
		//May 6, 2013 - Added "random", since two calls asking for a random
		//Jun 4, 2013 - Added "now" and "today", since these could change during the course of a survey
		if(!id.equals(x.id) || args.length != x.args.length ||
			id.toString().equals("uuid") ||
			id.toString().equals("random") ||
			id.toString().equals("once") ||
			id.toString().equals("now") ||
			id.toString().equals("today")) {
			return false;
		}

		return ExtUtil.arrayEquals(args, x.args);
	} else {
		return false;
	}
}
 
开发者ID:medic,项目名称:javarosa,代码行数:25,代码来源:XPathFuncExpr.java


示例2: readExternal

import org.javarosa.core.util.externalizable.ExtUtil; //导入依赖的package包/类
public void readExternal(DataInputStream dis, PrototypeFactory pf) throws IOException, DeserializationException {
	setID(ExtUtil.readInt(dis));
	binding = (IDataReference)ExtUtil.read(dis, new ExtWrapNullable(new ExtWrapTagged()), pf);
	setAppearanceAttr((String)ExtUtil.read(dis, new ExtWrapNullable(String.class), pf));
	setTextID((String)ExtUtil.read(dis, new ExtWrapNullable(String.class), pf));
	setLabelInnerText((String)ExtUtil.read(dis, new ExtWrapNullable(String.class), pf));
	setHelpText((String)ExtUtil.read(dis, new ExtWrapNullable(String.class), pf));
	setHelpTextID((String)ExtUtil.read(dis, new ExtWrapNullable(String.class), pf));
       setHelpInnerText((String)ExtUtil.read(dis, new ExtWrapNullable(String.class), pf));

	setControlType(ExtUtil.readInt(dis));

	additionalAttributes = ExtUtil.readAttributes(dis, null);

	choices = (List<SelectChoice>) ExtUtil.nullIfEmpty((List<SelectChoice>)ExtUtil.read(dis, new ExtWrapList(SelectChoice.class), pf));
	for (int i = 0; i < getNumChoices(); i++) {
		choices.get(i).setIndex(i);
	}
	setDynamicChoices((ItemsetBinding)ExtUtil.read(dis, new ExtWrapNullable(ItemsetBinding.class)));
}
 
开发者ID:medic,项目名称:javarosa,代码行数:21,代码来源:QuestionDef.java


示例3: writeExternal

import org.javarosa.core.util.externalizable.ExtUtil; //导入依赖的package包/类
public void writeExternal(DataOutputStream dos) throws IOException {
	ExtUtil.writeNumeric(dos, getID());
	ExtUtil.write(dos, new ExtWrapNullable(binding == null ? null : new ExtWrapTagged(binding)));
	ExtUtil.write(dos, new ExtWrapNullable(getAppearanceAttr()));
	ExtUtil.write(dos, new ExtWrapNullable(getTextID()));
	ExtUtil.write(dos, new ExtWrapNullable(getLabelInnerText()));
	ExtUtil.write(dos, new ExtWrapNullable(getHelpText()));
	ExtUtil.write(dos, new ExtWrapNullable(getHelpTextID()));
       ExtUtil.write(dos, new ExtWrapNullable(getHelpInnerText()));

	ExtUtil.writeNumeric(dos, getControlType());

	ExtUtil.writeAttributes(dos, additionalAttributes);

	ExtUtil.write(dos, new ExtWrapList(ExtUtil.emptyIfNull(choices)));
	ExtUtil.write(dos, new ExtWrapNullable(dynamicChoices));
}
 
开发者ID:medic,项目名称:javarosa,代码行数:18,代码来源:QuestionDef.java


示例4: equals

import org.javarosa.core.util.externalizable.ExtUtil; //导入依赖的package包/类
public boolean equals (Object o) {
	if (o instanceof XPathStep) {
		XPathStep x = (XPathStep)o;

		//shortcuts for faster evaluation
		if(axis != x.axis || test != x.test || predicates.length != x.predicates.length) {
			return false;
		}

		switch (test) {
		case TEST_NAME: if(!name.equals(x.name)) {return false;} break;
		case TEST_NAMESPACE_WILDCARD: if(!namespace.equals(x.namespace)) {return false;} break;
		case TEST_TYPE_PROCESSING_INSTRUCTION: if(!ExtUtil.equals(literal, x.literal)) {return false;} break;
		default: break;
		}

		return ExtUtil.arrayEquals(predicates, x.predicates);
	} else {
		return false;
	}
}
 
开发者ID:medic,项目名称:javarosa,代码行数:22,代码来源:XPathStep.java


示例5: readExternal

import org.javarosa.core.util.externalizable.ExtUtil; //导入依赖的package包/类
/** Reads a group definition object from the supplied stream. */
public void readExternal(DataInputStream dis, PrototypeFactory pf) throws IOException, DeserializationException {
	setID(ExtUtil.readInt(dis));
	setAppearanceAttr((String)ExtUtil.read(dis, new ExtWrapNullable(String.class), pf));
	setBind((IDataReference)ExtUtil.read(dis, new ExtWrapTagged(), pf));
	setTextID((String)ExtUtil.read(dis, new ExtWrapNullable(String.class), pf));
	setLabelInnerText((String)ExtUtil.read(dis, new ExtWrapNullable(String.class), pf));
	setRepeat(ExtUtil.readBool(dis));
	setChildren((List<IFormElement>)ExtUtil.read(dis, new ExtWrapListPoly(), pf));

	noAddRemove = ExtUtil.readBool(dis);
	count = (IDataReference)ExtUtil.read(dis, new ExtWrapNullable(new ExtWrapTagged()), pf);

	chooseCaption = ExtUtil.nullIfEmpty(ExtUtil.readString(dis));
	addCaption = ExtUtil.nullIfEmpty(ExtUtil.readString(dis));
	delCaption = ExtUtil.nullIfEmpty(ExtUtil.readString(dis));
	doneCaption = ExtUtil.nullIfEmpty(ExtUtil.readString(dis));
	addEmptyCaption = ExtUtil.nullIfEmpty(ExtUtil.readString(dis));
	doneEmptyCaption = ExtUtil.nullIfEmpty(ExtUtil.readString(dis));
	entryHeader = ExtUtil.nullIfEmpty(ExtUtil.readString(dis));
	delHeader = ExtUtil.nullIfEmpty(ExtUtil.readString(dis));
	mainHeader = ExtUtil.nullIfEmpty(ExtUtil.readString(dis));

	additionalAttributes = ExtUtil.readAttributes(dis, null);
}
 
开发者ID:medic,项目名称:javarosa,代码行数:26,代码来源:GroupDef.java


示例6: writeExternal

import org.javarosa.core.util.externalizable.ExtUtil; //导入依赖的package包/类
/** Write the group definition object to the supplied stream. */
public void writeExternal(DataOutputStream dos) throws IOException {
	ExtUtil.writeNumeric(dos, getID());
	ExtUtil.write(dos, new ExtWrapNullable(getAppearanceAttr()));
	ExtUtil.write(dos, new ExtWrapTagged(getBind()));
	ExtUtil.write(dos, new ExtWrapNullable(getTextID()));
	ExtUtil.write(dos, new ExtWrapNullable(getLabelInnerText()));
	ExtUtil.writeBool(dos, getRepeat());
	ExtUtil.write(dos, new ExtWrapListPoly(getChildren()));

	ExtUtil.writeBool(dos, noAddRemove);
	ExtUtil.write(dos, new ExtWrapNullable(count != null ? new ExtWrapTagged(count) : null));

	ExtUtil.writeString(dos, ExtUtil.emptyIfNull(chooseCaption));
	ExtUtil.writeString(dos, ExtUtil.emptyIfNull(addCaption));
	ExtUtil.writeString(dos, ExtUtil.emptyIfNull(delCaption));
	ExtUtil.writeString(dos, ExtUtil.emptyIfNull(doneCaption));
	ExtUtil.writeString(dos, ExtUtil.emptyIfNull(addEmptyCaption));
	ExtUtil.writeString(dos, ExtUtil.emptyIfNull(doneEmptyCaption));
	ExtUtil.writeString(dos, ExtUtil.emptyIfNull(entryHeader));
	ExtUtil.writeString(dos, ExtUtil.emptyIfNull(delHeader));
	ExtUtil.writeString(dos, ExtUtil.emptyIfNull(mainHeader));

	ExtUtil.writeAttributes(dos, additionalAttributes);
}
 
开发者ID:medic,项目名称:javarosa,代码行数:26,代码来源:GroupDef.java


示例7: listGroup

import org.javarosa.core.util.externalizable.ExtUtil; //导入依赖的package包/类
private static boolean listGroup (FormDef f, GroupDef g, int indent, StringBuilder sb) {
	FormEntryModel femodel = new FormEntryModel(f);
	boolean repeat = g.getRepeat();
	String caption = ExtUtil.nullIfEmpty(femodel.getCaptionPrompt().getLongText());
	TreeElement instanceNode = getInstanceNode(f.getInstance(), g.getBind());

	String relevant = printConditionalProperty("relevant", f, instanceNode);
	String readonly = printConditionalProperty("readonly", f, instanceNode);

	if (repeat || caption != null || (relevant != null || readonly != null)) {
		println(sb, indent, (repeat ? "Repeat" : "Group") + ":" + (caption != null ? " \"" + caption + "\"" : ""));

		if (relevant != null) {
			println(sb, indent + 1, relevant);
		}

		if (readonly != null) {
			println(sb, indent + 1, readonly);
		}

		println(sb);

		return true;
	} else {
		return false;
	}
}
 
开发者ID:medic,项目名称:javarosa,代码行数:28,代码来源:FormOverview.java


示例8: readExternal

import org.javarosa.core.util.externalizable.ExtUtil; //导入依赖的package包/类
public void readExternal(DataInputStream in, PrototypeFactory pf) throws IOException, DeserializationException {
	id = (XPathQName)ExtUtil.read(in, XPathQName.class);
       List<Object> v = (List<Object>)ExtUtil.read(in, new ExtWrapListPoly(), pf);

	args = new XPathExpression[v.size()];
	for (int i = 0; i < args.length; i++)
		args[i] = (XPathExpression)v.get(i);
}
 
开发者ID:medic,项目名称:javarosa,代码行数:9,代码来源:XPathFuncExpr.java


示例9: readExternal

import org.javarosa.core.util.externalizable.ExtUtil; //导入依赖的package包/类
public void readExternal(DataInputStream in, PrototypeFactory pf) throws IOException, DeserializationException {
	if (in.readByte() == (byte)0x00) {
		d = ExtUtil.readNumeric(in);
	} else {
		d = ExtUtil.readDecimal(in);
	}
}
 
开发者ID:medic,项目名称:javarosa,代码行数:8,代码来源:XPathNumericLiteral.java


示例10: writeExternal

import org.javarosa.core.util.externalizable.ExtUtil; //导入依赖的package包/类
public void writeExternal(DataOutputStream out) throws IOException {
	if (d == (int)d) {
		out.writeByte(0x00);
		ExtUtil.writeNumeric(out, (int)d);
	} else {
		out.writeByte(0x01);
		ExtUtil.writeDecimal(out, d);
	}
}
 
开发者ID:medic,项目名称:javarosa,代码行数:10,代码来源:XPathNumericLiteral.java


示例11: equals

import org.javarosa.core.util.externalizable.ExtUtil; //导入依赖的package包/类
public boolean equals (Object o) {
	if (o instanceof Localizer) {
		Localizer l = (Localizer)o;

		//TODO: Compare all resources
		return (ExtUtil.equals(locales, locales) &&
				ExtUtil.equals(localeResources, l.localeResources) &&
				ExtUtil.equals(defaultLocale, l.defaultLocale) &&
				ExtUtil.equals(currentLocale, l.currentLocale) &&
				fallbackDefaultLocale == l.fallbackDefaultLocale &&
				fallbackDefaultForm == l.fallbackDefaultForm);
	} else {
		return false;
	}
}
 
开发者ID:medic,项目名称:javarosa,代码行数:16,代码来源:Localizer.java


示例12: readExternal

import org.javarosa.core.util.externalizable.ExtUtil; //导入依赖的package包/类
public void readExternal(DataInputStream in, PrototypeFactory pf) throws IOException, DeserializationException {
	x = (XPathExpression)ExtUtil.read(in, new ExtWrapTagged(), pf);
       List<Object> v = (List<Object>)ExtUtil.read(in, new ExtWrapListPoly(), pf);

	predicates = new XPathExpression[v.size()];
	for (int i = 0; i < predicates.length; i++)
		predicates[i] = (XPathExpression)v.get(i);
}
 
开发者ID:medic,项目名称:javarosa,代码行数:9,代码来源:XPathFilterExpr.java


示例13: equals

import org.javarosa.core.util.externalizable.ExtUtil; //导入依赖的package包/类
public boolean equals (Object o) {
	if (o instanceof XPathPathExpr) {
		XPathPathExpr x = (XPathPathExpr)o;

		//Shortcuts for easily comparable values
		if(init_context != x.init_context || steps.length != x.steps.length) {
			return false;
		}

		return ExtUtil.arrayEquals(steps, x.steps) && (init_context == INIT_CONTEXT_EXPR ? filtExpr.equals(x.filtExpr) : true);
	} else {
		return false;
	}
}
 
开发者ID:medic,项目名称:javarosa,代码行数:15,代码来源:XPathPathExpr.java


示例14: readExternal

import org.javarosa.core.util.externalizable.ExtUtil; //导入依赖的package包/类
public void readExternal(DataInputStream in, PrototypeFactory pf) throws IOException, DeserializationException {
	init_context = ExtUtil.readInt(in);
	if (init_context == INIT_CONTEXT_EXPR) {
		filtExpr = (XPathFilterExpr)ExtUtil.read(in, XPathFilterExpr.class, pf);
	}

     List<Object> v = (List<Object>)ExtUtil.read(in, new ExtWrapList(XPathStep.class), pf);
	steps = new XPathStep[v.size()];
	for (int i = 0; i < steps.length; i++)
		steps[i] = ((XPathStep)v.get(i)).intern();
}
 
开发者ID:medic,项目名称:javarosa,代码行数:12,代码来源:XPathPathExpr.java


示例15: writeExternal

import org.javarosa.core.util.externalizable.ExtUtil; //导入依赖的package包/类
public void writeExternal(DataOutputStream out) throws IOException {
	ExtUtil.writeNumeric(out, init_context);
	if (init_context == INIT_CONTEXT_EXPR) {
		ExtUtil.write(out, filtExpr);
	}

     List<XPathStep> v = Arrays.asList(steps);
	ExtUtil.write(out, new ExtWrapList(v));
}
 
开发者ID:medic,项目名称:javarosa,代码行数:10,代码来源:XPathPathExpr.java


示例16: writeExternal

import org.javarosa.core.util.externalizable.ExtUtil; //导入依赖的package包/类
public void writeExternal(DataOutputStream out) throws IOException {
	ExtUtil.writeNumeric(out, axis);
	ExtUtil.writeNumeric(out, test);

	switch (test) {
	case TEST_NAME: ExtUtil.write(out, name); break;
	case TEST_NAMESPACE_WILDCARD: ExtUtil.writeString(out, namespace); break;
	case TEST_TYPE_PROCESSING_INSTRUCTION: ExtUtil.write(out, new ExtWrapNullable(literal)); break;
	}

     List<XPathExpression> v = Arrays.asList(predicates);
     
	ExtUtil.write(out, new ExtWrapListPoly(v));
}
 
开发者ID:medic,项目名称:javarosa,代码行数:15,代码来源:XPathStep.java


示例17: readExternal

import org.javarosa.core.util.externalizable.ExtUtil; //导入依赖的package包/类
public void readExternal(DataInputStream in, PrototypeFactory pf) throws IOException, DeserializationException {
	setId((String)ExtUtil.read(in, new ExtWrapNullable(String.class), pf));
	setDataType(ExtUtil.readInt(in));
	setPreload((String)ExtUtil.read(in, new ExtWrapNullable(String.class), pf));
	setPreloadParams((String)ExtUtil.read(in, new ExtWrapNullable(String.class), pf));
	ref = (IDataReference)ExtUtil.read(in, new ExtWrapTagged());

	//don't bother reading relevancy/required/readonly/constraint/calculate/additionalAttrs right now; they're only used during parse anyway
}
 
开发者ID:medic,项目名称:javarosa,代码行数:10,代码来源:DataBinding.java


示例18: writeExternal

import org.javarosa.core.util.externalizable.ExtUtil; //导入依赖的package包/类
public void writeExternal(DataOutputStream out) throws IOException {
	ExtUtil.write(out, new ExtWrapNullable(getId()));
	ExtUtil.writeNumeric(out, getDataType());
	ExtUtil.write(out, new ExtWrapNullable(getPreload()));
	ExtUtil.write(out, new ExtWrapNullable(getPreloadParams()));
	ExtUtil.write(out, new ExtWrapTagged(ref));

	//don't bother writing relevancy/required/readonly/constraint/calculate/additionalAttrs right now; they're only used during parse anyway
}
 
开发者ID:medic,项目名称:javarosa,代码行数:10,代码来源:DataBinding.java


示例19: readExternal

import org.javarosa.core.util.externalizable.ExtUtil; //导入依赖的package包/类
public void readExternal(DataInputStream in, PrototypeFactory pf) throws IOException, DeserializationException {
	isLocalizable = ExtUtil.readBool(in);
	setLabelInnerText(ExtUtil.nullIfEmpty(ExtUtil.readString(in)));
	setTextID(ExtUtil.nullIfEmpty(ExtUtil.readString(in)));
	value = ExtUtil.nullIfEmpty(ExtUtil.readString(in));
	//index will be set by questiondef
}
 
开发者ID:medic,项目名称:javarosa,代码行数:8,代码来源:SelectChoice.java


示例20: readExternal

import org.javarosa.core.util.externalizable.ExtUtil; //导入依赖的package包/类
public void readExternal(DataInputStream in, PrototypeFactory pf)
		throws IOException, DeserializationException {
	int length = in.readInt();
	if(length > 0) {
		this.payload = new byte[length];
		in.read(this.payload);
	}
	id = ExtUtil.nullIfEmpty(ExtUtil.readString(in));
}
 
开发者ID:medic,项目名称:javarosa,代码行数:10,代码来源:ByteArrayPayload.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java DateEnd类代码示例发布时间:2022-05-23
下一篇:
Java AFUNIXServerSocket类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap