Categories:
Audio (13)
Biotech (29)
Bytecode (36)
Database (77)
Framework (7)
Game (7)
General (507)
Graphics (53)
I/O (35)
IDE (2)
JAR Tools (102)
JavaBeans (21)
JDBC (121)
JDK (426)
JSP (20)
Logging (108)
Mail (58)
Messaging (8)
Network (84)
PDF (97)
Report (7)
Scripting (84)
Security (32)
Server (121)
Servlet (26)
SOAP (24)
Testing (54)
Web (15)
XML (322)
Collections:
Other Resources:
Woodstox 6.4.0 - Source Code Files
Woodstox 6.4.0 Source Code Files are provided at the Woodstox GitHub Website.
You can download them from the "src/main/java" folder.
You can also browse Woodstox Source Code files below:
✍: FYIcenter
⏎ com/ctc/wstx/dtd/ConcatModel.java
package com.ctc.wstx.dtd;
import java.util.*;
/**
* Model class that represents sequence of 2 sub-models, needed to be
* matched in the order.
*/
public class ConcatModel
extends ModelNode
{
ModelNode mLeftModel;
ModelNode mRightModel;
final boolean mNullable;
BitSet mFirstPos, mLastPos;
/*
///////////////////////////////////////////////////
// Life-cycle
///////////////////////////////////////////////////
*/
public ConcatModel(ModelNode left, ModelNode right)
{
super();
mLeftModel = left;
mRightModel = right;
mNullable = mLeftModel.isNullable() && mRightModel.isNullable();
}
/*
///////////////////////////////////////////////////
// Public API
///////////////////////////////////////////////////
*/
/**
* Method that has to create a deep copy of the model, without
* sharing any of existing Objects.
*/
@Override
public ModelNode cloneModel() {
return new ConcatModel(mLeftModel.cloneModel(), mRightModel.cloneModel());
}
@Override
public boolean isNullable() {
return mNullable;
}
@Override
public void indexTokens(List<TokenModel> tokens)
{
mLeftModel.indexTokens(tokens);
mRightModel.indexTokens(tokens);
}
@Override
public void addFirstPos(BitSet pos) {
if (mFirstPos == null) {
mFirstPos = new BitSet();
mLeftModel.addFirstPos(mFirstPos);
if (mLeftModel.isNullable()) {
mRightModel.addFirstPos(mFirstPos);
}
}
pos.or(mFirstPos);
}
@Override
public void addLastPos(BitSet pos) {
if (mLastPos == null) {
mLastPos = new BitSet();
mRightModel.addLastPos(mLastPos);
if (mRightModel.isNullable()) {
mLeftModel.addLastPos(mLastPos);
}
}
pos.or(mLastPos);
}
@Override
public void calcFollowPos(BitSet[] followPosSets)
{
// Let's let sub-models do what they need to do
mLeftModel.calcFollowPos(followPosSets);
mRightModel.calcFollowPos(followPosSets);
/* And then we can calculate follower sets between left and
* right sub models; so that left model's last position entries
* have right model's first position entries included
*/
BitSet foll = new BitSet();
mRightModel.addFirstPos(foll);
BitSet toAddTo = new BitSet();
mLeftModel.addLastPos(toAddTo);
int ix = 0; // need to/can skip the null entry (index 0)
while ((ix = toAddTo.nextSetBit(ix+1)) >= 0) {
// Ok; so token at this index needs to have follow positions added...
followPosSets[ix].or(foll);
}
}
@Override
public String toString()
{
StringBuilder sb = new StringBuilder();
sb.append('(');
sb.append(mLeftModel.toString());
sb.append(", ");
sb.append(mRightModel.toString());
sb.append(')');
return sb.toString();
}
}
⏎ com/ctc/wstx/dtd/ConcatModel.java
Or download all of them as a single archive file:
File name: woodstox-core-6.4.0-fyi.zip File size: 552992 bytes Release date: 2022-10-25 Download
⇒ woodstox-core-6.4.0.jar - Woodstox Core 6.4.0
⇐ What Is Woodstox XML Processing
2023-01-29, ≈46🔥, 0💬
Popular Posts:
Rhino JavaScript Java Library is an open-source implementation of JavaScript written entirely in Jav...
JDK 11 jdk.jcmd.jmod is the JMOD file for JDK 11 JCmd tool, which can be invoked by the "jcmd" comma...
What JAR files are required to run sax\Writer.java provided in the Apache Xerces package? 1 JAR file...
What Is wstx-asl-3.2.8.jar? wstx-asl-3.2.8.jar is JAR file for the ASL component of Woodstox 3.2.8. ...
maven-core-3.8.6.jar is the JAR file for Apache Maven 3.8.6 Core module. Apache Maven is a software ...