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


Java VTDNavHuge类代码示例

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


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

示例1: getSize

import com.ximpleware.extended.VTDNavHuge; //导入依赖的package包/类
/**
 * getSize gets the byte length of ns compensated fragment in its source
 * encoding format
 * @return the byte length of ns compensated fragment in its source encoding format
 *
 */
public final long getSize(){
    //int encoding = vn.encoding;
    long len = l[1];
    if (stLen != 0)
        for (int i = 0; i < fib.size(); i++) {
            int k = fib.intAt(i);
            if (vn.encoding < VTDNavHuge.FORMAT_UTF_16BE ){
                len += (vn.getTokenLength(k) & 0xffff)
                    + vn.getTokenLength(k + 1) + 4;
            }else{
                len += ((vn.getTokenLength(k) & 0xffff)
                	+ vn.getTokenLength(k + 1) + 4)<<1;
            }
        }
    return len;
}
 
开发者ID:CoolBalance,项目名称:vtd-xml,代码行数:23,代码来源:ElementFragmentNsHuge.java

示例2: exportTransitions130

import com.ximpleware.extended.VTDNavHuge; //导入依赖的package包/类
/**
 * Export transitions into NUPN (since 1.3.0)
 * 
 * @param ap
 * @param vn
 * @param bpnQueue
 * @param tsQueue
 * @throws XPathParseExceptionHuge
 * @throws NavExceptionHuge
 * @throws InterruptedException
 * @throws XPathEvalExceptionHuge
 */
private void exportTransitions130(AutoPilotHuge ap, VTDNavHuge vn, BlockingQueue<String> bpnQueue)
		throws XPathParseExceptionHuge, NavExceptionHuge, InterruptedException, XPathEvalExceptionHuge {
	long nb = trId2bpnMap.size();
	StringBuilder bpnsb = new StringBuilder();
	bpnsb.append(TRANSITIONS).append(WS).append(HK).append(nb).append(WS).append(ZERO).append(DOTS).append(nb - 1L)
			.append(NL);
	bpnQueue.put(bpnsb.toString());
	bpnsb.delete(0, bpnsb.length());

	LongCollection allTr = new LongRBTreeSet(trId2bpnMap.values());

	for (long trId : allTr) {
		bpnsb.append(T).append(trId);
		buildConnectedPlaces2Transition(bpnsb, trId, tr2InPlacesMap);
		buildConnectedPlaces2Transition(bpnsb, trId, tr2OutPlacesMap);
		bpnsb.append(NL);
		bpnQueue.put(bpnsb.toString());
		bpnsb.delete(0, bpnsb.length());
	}
	bpnsb.delete(0, bpnsb.length());
	bpnsb = null;
}
 
开发者ID:lip6,项目名称:pnml2nupn,代码行数:35,代码来源:PNML2NUPNExporter.java

示例3: isPTNet

import com.ximpleware.extended.VTDNavHuge; //导入依赖的package包/类
private boolean isPTNet(AutoPilotHuge ap, VTDNavHuge vn) throws XPathParseExceptionHuge, XPathEvalExceptionHuge,
		NavExceptionHuge {
	boolean result = true;
	ap.selectXPath(PNMLPaths.NETS_PATH);
	while ((ap.evalXPath()) != -1) {
		vn.push();
		String netType = vn.toString(vn.getAttrVal(PNMLPaths.TYPE_ATTR));
		log.info("Discovered net type: {}", netType);
		if (!netType.endsWith(PNMLPaths.PTNET_TYPE)) {
			result = false;
			break;
		}
		vn.pop();
	}
	ap.resetXPath();
	vn.toElement(VTDNavHuge.ROOT);
	return result;
}
 
开发者ID:lip6,项目名称:pnml2nupn,代码行数:19,代码来源:PNML2NUPNExporter.java

示例4: isNet1Safe

import com.ximpleware.extended.VTDNavHuge; //导入依赖的package包/类
@SuppressWarnings("unused")
private boolean isNet1Safe(AutoPilotHuge ap, VTDNavHuge vn) throws XPathParseExceptionHuge, NavExceptionHuge,
		NumberFormatException, XPathEvalExceptionHuge {
	boolean result = true;
	long count = 0L;
	String mkg;
	ap.selectXPath(PNMLPaths.MARKED_PLACES);
	while ((ap.evalXPath()) != -1) {
		vn.push();
		mkg = vn.toString(vn.getText());
		if (Long.valueOf(mkg) == 1) {
			count++;
		} else {
			break;
		}
		vn.pop();
	}
	ap.resetXPath();
	vn.toElement(VTDNavHuge.ROOT);
	if (count != 1L) {
		result = false;
	}
	return result;
}
 
开发者ID:lip6,项目名称:pnml2nupn,代码行数:25,代码来源:PNML2NUPNExporter.java

示例5: ElementFragmentNsHuge

import com.ximpleware.extended.VTDNavHuge; //导入依赖的package包/类
/**
 * 
 * @param vn1
 * @param l1
 * @param fib1
 * @param len
 */
protected ElementFragmentNsHuge(VTDNavHuge vn1, long l1[], FastIntBuffer fib1, long len){
    UTF_8_Size = -1;
    ASCII_Size = -1;
    ISO_8859_1_Size = -1;
    UTF_16_BE_Size = -1;
    UTF_16_LE_Size = -1;
    vn = vn1;
    l = l1;
    fib = fib1;
    stLen = len;        
}
 
开发者ID:CoolBalance,项目名称:vtd-xml,代码行数:19,代码来源:ElementFragmentNsHuge.java

示例6: evalBoolean

import com.ximpleware.extended.VTDNavHuge; //导入依赖的package包/类
public boolean evalBoolean(VTDNavHuge vn) {
	// TODO Auto-generated method stub
	return exprVal.evalBoolean(vn);
}
 
开发者ID:CoolBalance,项目名称:vtd-xml,代码行数:5,代码来源:VariableExpr.java

示例7: evalNodeSet

import com.ximpleware.extended.VTDNavHuge; //导入依赖的package包/类
public int evalNodeSet(VTDNavHuge vn) throws XPathEvalExceptionHuge, NavExceptionHuge {
	// TODO Auto-generated method stub
	return exprVal.evalNodeSet(vn);
}
 
开发者ID:CoolBalance,项目名称:vtd-xml,代码行数:5,代码来源:VariableExpr.java

示例8: evalNumber

import com.ximpleware.extended.VTDNavHuge; //导入依赖的package包/类
public double evalNumber(VTDNavHuge vn) {
	// TODO Auto-generated method stub
	return exprVal.evalNumber(vn);
}
 
开发者ID:CoolBalance,项目名称:vtd-xml,代码行数:5,代码来源:VariableExpr.java

示例9: evalString

import com.ximpleware.extended.VTDNavHuge; //导入依赖的package包/类
public String evalString(VTDNavHuge vn) {
	// TODO Auto-generated method stub
	return exprVal.evalString(vn);
}
 
开发者ID:CoolBalance,项目名称:vtd-xml,代码行数:5,代码来源:VariableExpr.java

示例10: reset

import com.ximpleware.extended.VTDNavHuge; //导入依赖的package包/类
public void reset(VTDNavHuge vn) {
	// TODO Auto-generated method stub
	exprVal.reset(vn);
}
 
开发者ID:CoolBalance,项目名称:vtd-xml,代码行数:5,代码来源:VariableExpr.java

示例11: checkHasUnsafeArcs

import com.ximpleware.extended.VTDNavHuge; //导入依赖的package包/类
private void checkHasUnsafeArcs(File inFile, File outFile, Logger journal) throws InvalidPNMLTypeException,
		IOException, PNMLImportExportException {
	XMLMemMappedBuffer xb = new XMLMemMappedBuffer();
	VTDGenHuge vg = new VTDGenHuge();
	long nbUnsArcs = 0L;
	initLog(journal);
	try {
		xb.readFile(inFile.getCanonicalPath());
		vg.setDoc(xb);
		vg.parse(true);
		VTDNavHuge vn = vg.getNav();
		AutoPilotHuge ap = new AutoPilotHuge(vn);
		log.info("Checking it is a PT Net.");
		if (!isPTNet(ap, vn)) {
			throw new InvalidPNMLTypeException(
					"The contained Petri net(s) in the following file is not a P/T Net. Only P/T Nets are supported: "
							+ inFile.getCanonicalPath());
		}
		outUAFile = new File(PNML2NUPNUtils.extractBaseName(outFile.getCanonicalPath()) + UNSAFE_ARC);
		ocbUA = PNML2NUPNUtils.openOutChannel(outUAFile);
		uaQueue = initQueue();
		Thread uaWriter = startWriter(ocbUA, uaQueue);

		// Check inscriptions > 1
		ap.resetXPath();
		vn.toElement(VTDNavHuge.ROOT);
		ap.selectXPath(PNMLPaths.UNSAFE_ARCS);
		StringBuilder unsafeArcsId = new StringBuilder();
		long val;
		String id, src, trg;
		while ((ap.evalXPath()) != -1) {
			vn.push();
			vn.toElement(VTDNavHuge.FIRST_CHILD);
			while (!vn.matchElement(TEXT)) {
				vn.toElement(VTDNavHuge.NEXT_SIBLING);
			}
			val = Long.parseLong(vn.toString(vn.getText()).trim());
			vn.toElement(VTDNavHuge.PARENT);
			vn.toElement(VTDNavHuge.PARENT);
			id = vn.toString(vn.getAttrVal(PNMLPaths.ID_ATTR));
			if (id != null) {
				src = vn.toString(vn.getAttrVal(PNMLPaths.SRC_ATTR));
				trg = vn.toString(vn.getAttrVal(PNMLPaths.TRG_ATTR));
				unsafeArcsId.append(src + WS + id + WS + trg + WS + HK + val + NL);
				uaQueue.put(unsafeArcsId.toString());
				nbUnsArcs++;
			}
			vn.pop();
			unsafeArcsId.delete(0, unsafeArcsId.length());
		}
		if (nbUnsArcs > 0) {
			journal.warn("There are {} unsafe arcs in this net.", nbUnsArcs);
		} else {
			log.info("There are no unsafe arcs in this net.");
		}
		stopWriter(uaQueue);
		uaWriter.join();
		closeChannel(ocbUA);
		if (nbUnsArcs > 0) {
			log.info("See unsafe arcs files: {}", outUAFile.getCanonicalPath());
		} else {
			outUAFile.delete();
		}
	} catch (ParseExceptionHuge | XPathParseExceptionHuge | XPathEvalExceptionHuge | NavExceptionHuge
			| InterruptedException e) {
		try {
			emergencyStop(outFile);
		} catch (InterruptedException e1) {
			e1.printStackTrace();
		}
		throw new PNMLImportExportException(e);
	}
}
 
开发者ID:lip6,项目名称:pnml2nupn,代码行数:74,代码来源:PNML2NUPNExporter.java


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