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/util/InternCache.java
package com.ctc.wstx.util;
import java.util.LinkedHashMap;
import java.util.Map;
/**
* Singleton class that implements "fast intern" functionality, essentially
* adding a layer that caches Strings that have been previously intern()ed,
* but that probably shouldn't be added to symbol tables.
* This is usually used by improving intern()ing of things like namespace
* URIs.
*<p>
* Note: that this class extends {@link LinkedHashMap} is an implementation
* detail -- no code should ever directly call Map methods.
*/
@SuppressWarnings("serial")
public final class InternCache extends LinkedHashMap<String,String>
{
/**
* Let's create cache big enough to usually have enough space for
* all entries... (assuming NS URIs only)
*/
private final static int DEFAULT_SIZE = 64;
/**
* Let's limit to hash area size of 1024.
*/
private final static int MAX_SIZE = 660;
private final static InternCache sInstance = new InternCache();
private InternCache() {
/* Let's also try to seriously minimize collisions... since
* collisions are likely to be more costly here, with longer
* Strings; so let's use 2/3 ratio (67%) instead of default
* (75%)
*/
super(DEFAULT_SIZE, 0.6666f, false);
}
public static InternCache getInstance() {
return sInstance;
}
public String intern(String input)
{
String result;
/* Let's split sync block to help in edge cases like
* [WSTX-220]
*/
synchronized (this) {
result = get(input);
}
if (result == null) {
result = input.intern();
synchronized (this) {
put(result, result);
}
}
return result;
}
// We will force maximum size here (for [WSTX-237])
@Override protected boolean removeEldestEntry(Map.Entry<String,String> eldest)
{
return size() > MAX_SIZE;
}
}
⏎ com/ctc/wstx/util/InternCache.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:
JDK 11 java.management.jmod is the JMOD file for JDK 11 Management module. JDK 11 Management module ...
JDK 17 java.rmi.jmod is the JMOD file for JDK 17 RMI (Remote Method Invocation) module. JDK 17 RMI m...
JDK 11 jdk.charsets.jmod is the JMOD file for JDK 11 Charsets module. JDK 11 Charsets module compile...
The Bouncy Castle Crypto package is a Java implementation of cryptographic algorithms, it was develo...
iText is an ideal library for developers looking to enhance web- and other applications with dynamic...