當前位置: 首頁>>代碼示例>>Java>>正文


Java MesquiteString.getValue方法代碼示例

本文整理匯總了Java中mesquite.lib.MesquiteString.getValue方法的典型用法代碼示例。如果您正苦於以下問題:Java MesquiteString.getValue方法的具體用法?Java MesquiteString.getValue怎麽用?Java MesquiteString.getValue使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在mesquite.lib.MesquiteString的用法示例。


在下文中一共展示了MesquiteString.getValue方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getTerminals

import mesquite.lib.MesquiteString; //導入方法依賴的package包/類
public static int getTerminals(Element element, String[] names, boolean[] leaves, boolean[] hasChildren, MesquiteString termName, MesquiteInteger c) {
	boolean isNode = isNode(element);
	boolean isName = "Name".equalsIgnoreCase(element.getName());
	List children = element.content();
	Iterator iterator = children.iterator();
	int terms = 0;
	while (iterator.hasNext()) {
		Object o = iterator.next();
		if (isName){
			if (o instanceof CDATA) {
				termName.setValue(((CDATA)o).getText());
			}
		}
		else if (o instanceof Element) {
			Element e = (Element)o;
			if (isContinuable(e))
				terms += getTerminals((Element) o, names, leaves,hasChildren, termName, c);
		}
	}
	if (isNode && terms == 0) {

		names[c.getValue()] =  new String(termName.getValue()); //element.getAttributeValue("NAME");
		if (isLeaf(element))
			leaves[c.getValue()] = true;
		else
			leaves[c.getValue()] = false;
		if (hasChildren(element))
			hasChildren[c.getValue()] = true;
		else
			hasChildren[c.getValue()] = false;
		c.increment();
		return 1;
	}
	else 
		return terms;

}
 
開發者ID:MesquiteProject,項目名稱:MesquiteArchive,代碼行數:38,代碼來源:ToLUtil.java

示例2: getTerminals

import mesquite.lib.MesquiteString; //導入方法依賴的package包/類
public static int getTerminals(Element element, String[] names, boolean[] leaves, boolean[] hasChildren, MesquiteString termName, MesquiteInteger c) {
	boolean isNode = isNode(element);
	boolean isName = "Name".equalsIgnoreCase(element.getName());
	List children = element.getContent();
	Iterator iterator = children.iterator();
	int terms = 0;
	while (iterator.hasNext()) {
		Object o = iterator.next();
		if (isName){
			if (o instanceof CDATA) {
				termName.setValue(((CDATA)o).getText());
			}
		}
		else if (o instanceof Element) {
			Element e = (Element)o;
			if (isContinuable(e))
				terms += getTerminals((Element) o, names, leaves,hasChildren, termName, c);
		}
	}
	if (isNode && terms == 0) {

		names[c.getValue()] =  new String(termName.getValue()); //element.getAttributeValue("NAME");
		if (isLeaf(element))
			leaves[c.getValue()] = true;
		else
			leaves[c.getValue()] = false;
		if (hasChildren(element))
			hasChildren[c.getValue()] = true;
		else
			hasChildren[c.getValue()] = false;
		c.increment();
		return 1;
	}
	else 
		return terms;

}
 
開發者ID:MesquiteProject,項目名稱:MesquiteArchive,代碼行數:38,代碼來源:ToLUtil.java

示例3: getTerminalsWithAuthors

import mesquite.lib.MesquiteString; //導入方法依賴的package包/類
public static int getTerminalsWithAuthors(Element element, String[] names, String[] authors, boolean[] leaves, boolean[] hasChildren, MesquiteString termName,MesquiteString authorName, MesquiteInteger c) {
	boolean isNode = isNode(element);
	boolean isName = "Name".equalsIgnoreCase(element.getName());
	boolean isAuthor = "Authority".equalsIgnoreCase(element.getName());
	List children = element.content();
	Iterator iterator = children.iterator();
	int terms = 0;
	while (iterator.hasNext()) {
		Object o = iterator.next();
		if (isName){
			if (o instanceof CDATA) {
				termName.setValue(((CDATA)o).getText());
			}
		}
		else if (isAuthor){
			if (o instanceof CDATA) {
				authorName.setValue(((CDATA)o).getText());
			}
		}
		else if (o instanceof Element) {
			Element e = (Element)o;
			if (isContinuable(e))
				terms += getTerminals((Element) o, names, leaves,hasChildren, termName, c);
		}
	}
	if (isNode && terms == 0) {

		names[c.getValue()] =  new String(termName.getValue()); //element.getAttributeValue("NAME");
		authors[c.getValue()] =  new String(authorName.getValue()); //element.getAttributeValue("NAME");
		if (isLeaf(element))
			leaves[c.getValue()] = true;
		else
			leaves[c.getValue()] = false;
		if (hasChildren(element))
			hasChildren[c.getValue()] = true;
		else
			hasChildren[c.getValue()] = false;
		c.increment();
		return 1;
	}
	else 
		return terms;

}
 
開發者ID:MesquiteProject,項目名稱:MesquiteArchive,代碼行數:45,代碼來源:ToLUtil.java


注:本文中的mesquite.lib.MesquiteString.getValue方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。