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/SimpleCache.java
package com.ctc.wstx.util;
import java.util.*;
/**
* Simple Map implementation usable for caches where contents do not
* expire, but where size needs to remain bounded.
*<p>
* Note: we probably should use weak references, or something similar
* to limit maximum memory usage. This could be implemented in many
* ways, perhaps by using two areas: first, smaller one, with strong
* refs, and secondary bigger one that uses soft references.
*/
public final class SimpleCache<K,V>
{
final LimitMap<K,V> mItems;
final int mMaxSize;
public SimpleCache(int maxSize)
{
mItems = new LimitMap<K,V>(maxSize);
mMaxSize = maxSize;
}
public V find(K key) {
return mItems.get(key);
}
public void add(K key, V value)
{
mItems.put(key, value);
}
/*
/////////////////////////////////////////////
// Helper classes
/////////////////////////////////////////////
*/
@SuppressWarnings("serial")
final static class LimitMap<K,V>
extends LinkedHashMap<K,V>
{
final int mMaxSize;
public LimitMap(int size)
{
super(size, 0.8f, true);
// Let's not allow silly low values...
mMaxSize = size;
}
@Override
public boolean removeEldestEntry(Map.Entry<K,V> eldest) {
return (size() >= mMaxSize);
}
}
}
⏎ com/ctc/wstx/util/SimpleCache.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, ≈45🔥, 0💬
Popular Posts:
What Is ojdbc7.jar for Oracle 12c R1? ojdbc7.jar for Oracle 12c R1 is the JAR files of ojdbc.jar, JD...
XML Serializer, Release 2.7.1, allows you to write out XML, HTML etc. as a stream of characters from...
JDK 11 jdk.internal.le.jmod is the JMOD file for JDK 11 Internal Line Editing module. JDK 11 Interna...
What Is ojdbc7.jar for Oracle 12c R1? ojdbc7.jar for Oracle 12c R1 is the JAR files of ojdbc.jar, JD...
How to download and install Apache ZooKeeper Source Package? Apache ZooKeeper is an open-source serv...