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/ChoiceModel.java
package com.ctc.wstx.dtd;
import java.util.*;
/**
* Model class that encapsulates set of sub-models, of which one (and only
* one) needs to be matched.
*/
public class ChoiceModel
extends ModelNode
{
final ModelNode[] mSubModels;
boolean mNullable = false;
BitSet mFirstPos, mLastPos;
/*
///////////////////////////////////////////////////
// Life-cycle
///////////////////////////////////////////////////
*/
protected ChoiceModel(ModelNode[] subModels)
{
super();
mSubModels = subModels;
boolean nullable = false;
for (int i = 0, len = subModels.length; i < len; ++i) {
if (subModels[i].isNullable()) {
nullable = true;
break;
}
}
mNullable = nullable;
}
/*
///////////////////////////////////////////////////
// Public API
///////////////////////////////////////////////////
*/
@Override
public String toString()
{
StringBuilder sb = new StringBuilder();
for (int i = 0; i < mSubModels.length; ++i) {
if (i > 0) {
sb.append(" | ");
}
sb.append(mSubModels[i].toString());
}
sb.append(')');
return sb.toString();
}
/**
* Method that has to create a deep copy of the model, without
* sharing any of existing Objects.
*/
@Override
public ModelNode cloneModel()
{
int len = mSubModels.length;
ModelNode[] newModels = new ModelNode[len];
for (int i = 0; i < len; ++i) {
newModels[i] = mSubModels[i].cloneModel();
}
return new ChoiceModel(newModels);
}
@Override
public boolean isNullable() {
return mNullable;
}
@Override
public void indexTokens(List<TokenModel> tokens)
{
// First, let's ask sub-models to calc their settings
for (int i = 0, len = mSubModels.length; i < len; ++i) {
mSubModels[i].indexTokens(tokens);
}
}
@Override
public void addFirstPos(BitSet firstPos) {
if (mFirstPos == null) {
mFirstPos = new BitSet();
for (int i = 0, len = mSubModels.length; i < len; ++i) {
mSubModels[i].addFirstPos(mFirstPos);
}
}
firstPos.or(mFirstPos);
}
@Override
public void addLastPos(BitSet lastPos) {
if (mLastPos == null) {
mLastPos = new BitSet();
for (int i = 0, len = mSubModels.length; i < len; ++i) {
mSubModels[i].addLastPos(mLastPos);
}
}
lastPos.or(mLastPos);
}
@Override
public void calcFollowPos(BitSet[] followPosSets)
{
// need to let child models do their stuff:
for (int i = 0, len = mSubModels.length; i < len; ++i) {
mSubModels[i].calcFollowPos(followPosSets);
}
}
}
⏎ com/ctc/wstx/dtd/ChoiceModel.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:
JAX-WS is an API for building web services and clients. It is the next generation Web Services API r...
JDK 11 jrt-fs.jar is the JAR file for JDK 11 JRT-FS (Java RunTime - File System) defined in the "jdk...
What Is poi-scratchpad-3.5.jar? poi-scratchpad-3.5.jar is one of the JAR files for Apache POI 3.5, w...
What Is commons-net-ftp-2.0.jar? commons-net-ftp-2.0.jar is the JAR file for Apache Commons Net FTP ...
What Is XMLBeans xbean.jar 2.6.0? XMLBeans xbean.jar 2.6.0 is the JAR file for Apache XMLBeans 2.6.0...