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


Java FormIndex.createEndOfFormIndex方法代码示例

本文整理汇总了Java中org.javarosa.core.model.FormIndex.createEndOfFormIndex方法的典型用法代码示例。如果您正苦于以下问题:Java FormIndex.createEndOfFormIndex方法的具体用法?Java FormIndex.createEndOfFormIndex怎么用?Java FormIndex.createEndOfFormIndex使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.javarosa.core.model.FormIndex的用法示例。


在下文中一共展示了FormIndex.createEndOfFormIndex方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: incrementIndex

import org.javarosa.core.model.FormIndex; //导入方法依赖的package包/类
public FormIndex incrementIndex(FormIndex index, boolean descend) {
     List<Integer> indexes = new ArrayList<Integer>();
     List<Integer> multiplicities = new ArrayList<Integer>();
     List<IFormElement> elements = new ArrayList<IFormElement>();

	if (index.isEndOfFormIndex()) {
		return index;
	} else if (index.isBeginningOfFormIndex()) {
		if (form.getChildren() == null || form.getChildren().size() == 0) {
			return FormIndex.createEndOfFormIndex();
		}
	} else {
		form.collapseIndex(index, indexes, multiplicities, elements);
	}

	incrementHelper(indexes, multiplicities, elements, descend);

	if (indexes.size() == 0) {
		return FormIndex.createEndOfFormIndex();
	} else {
		return form.buildIndex(indexes, multiplicities, elements);
	}
}
 
开发者ID:medic,项目名称:javarosa,代码行数:24,代码来源:FormEntryModel.java

示例2: incrementIndex

import org.javarosa.core.model.FormIndex; //导入方法依赖的package包/类
public FormIndex incrementIndex(FormIndex index, boolean descend) {
    Vector indexes = new Vector();
    Vector multiplicities = new Vector();
    Vector elements = new Vector();

    if (index.isEndOfFormIndex()) {
        return index;
    } else if (index.isBeginningOfFormIndex()) {
        if (form.getChildren() == null || form.getChildren().size() == 0) {
            return FormIndex.createEndOfFormIndex();
        }
    } else {
        form.collapseIndex(index, indexes, multiplicities, elements);
    }

    incrementHelper(indexes, multiplicities, elements, descend);

    if (indexes.size() == 0) {
        return FormIndex.createEndOfFormIndex();
    } else {
        return form.buildIndex(indexes, multiplicities, elements);
    }
}
 
开发者ID:dimagi,项目名称:commcare-j2me,代码行数:24,代码来源:FormEntryModel.java

示例3: incrementIndex

import org.javarosa.core.model.FormIndex; //导入方法依赖的package包/类
public FormIndex incrementIndex(FormIndex index, boolean descend) {
    Vector<Integer> indexes = new Vector<>();
    Vector<Integer> multiplicities = new Vector<>();
    Vector<IFormElement> elements = new Vector<>();

    if (index.isEndOfFormIndex()) {
        return index;
    } else if (index.isBeginningOfFormIndex()) {
        if (form.getChildren() == null || form.getChildren().size() == 0) {
            return FormIndex.createEndOfFormIndex();
        }
    } else {
        form.collapseIndex(index, indexes, multiplicities, elements);
    }

    incrementHelper(indexes, multiplicities, elements, descend);

    if (indexes.size() == 0) {
        return FormIndex.createEndOfFormIndex();
    } else {
        return form.buildIndex(indexes, multiplicities, elements);
    }
}
 
开发者ID:dimagi,项目名称:commcare-core,代码行数:24,代码来源:FormEntryModel.java

示例4: getIndexFromXPath

import org.javarosa.core.model.FormIndex; //导入方法依赖的package包/类
public FormIndex getIndexFromXPath(String xPath) {
 	if ( xPath.equals("beginningOfForm") ) {
         return FormIndex.createBeginningOfFormIndex();
 	} else if ( xPath.equals("endOfForm") ) {
 		return FormIndex.createEndOfFormIndex();
 	} else if ( xPath.equals("unexpected") ) {
 		Log.e(t, "Unexpected string from XPath");
 		throw new IllegalArgumentException("unexpected string from XPath");
 	} else {
 		FormIndex returned = null;
FormIndex saved = getFormIndex();
// the only way I know how to do this is to step through the entire form
// until the XPath of a form entry matches that of the supplied XPath
try {
	jumpToIndex(FormIndex.createBeginningOfFormIndex());
	int event = stepToNextEvent(true);
	while ( event != FormEntryController.EVENT_END_OF_FORM ) {
		String candidateXPath = getXPath(getFormIndex());
		// Log.i(t, "xpath: " + candidateXPath);
		if ( candidateXPath.equals(xPath) ) {
			returned = getFormIndex();
			break;
		}
		event = stepToNextEvent(true);
	}
} finally {
	jumpToIndex(saved);
}
return returned;
 	}
 }
 
开发者ID:Last-Mile-Health,项目名称:ODK-Liberia,代码行数:32,代码来源:FormController.java

示例5: getIndexFromXPath

import org.javarosa.core.model.FormIndex; //导入方法依赖的package包/类
public FormIndex getIndexFromXPath(String xPath) {
 	if ( xPath.equals("beginningOfForm") ) {
         return FormIndex.createBeginningOfFormIndex();
 	} else if ( xPath.equals("endOfForm") ) {
 		return FormIndex.createEndOfFormIndex();
 	} else if ( xPath.equals("unexpected") ) {
 		System.err.printf(t, "Unexpected string from XPath");
 		throw new IllegalArgumentException("unexpected string from XPath");
 	} else {
 		FormIndex returned = null;
FormIndex saved = getFormIndex();
// the only way I know how to do this is to step through the entire form
// until the XPath of a form entry matches that of the supplied XPath
try {
	jumpToIndex(FormIndex.createBeginningOfFormIndex());
	int event = stepToNextEvent(true);
	while ( event != FormEntryController.EVENT_END_OF_FORM ) {
		String candidateXPath = getXPath(getFormIndex());
		// Log.i(t, "xpath: " + candidateXPath);
		if ( candidateXPath.equals(xPath) ) {
			returned = getFormIndex();
			break;
		}
		event = stepToNextEvent(true);
	}
} finally {
	jumpToIndex(saved);
}
return returned;
 	}
 }
 
开发者ID:smap-consulting,项目名称:smap-survey-manager,代码行数:32,代码来源:FormController.java


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