diff --git a/src/scratchpad/src/org/apache/poi/hwpf/model/CachedPropertyNode.java b/src/scratchpad/src/org/apache/poi/hwpf/model/CachedPropertyNode.java new file mode 100644 index 000000000..35309381f --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hwpf/model/CachedPropertyNode.java @@ -0,0 +1,36 @@ +package org.apache.poi.hwpf.model; + +import org.apache.poi.hwpf.sprm.SprmBuffer; + +import java.lang.ref.SoftReference; + +public class CachedPropertyNode + extends PropertyNode +{ + protected SoftReference _propCache; + + public CachedPropertyNode(int start, int end, SprmBuffer buf) + { + super(start, end, buf); + } + + protected void fillCache(Object ref) + { + _propCache = new SoftReference(ref); + } + + protected Object getCacheContents() + { + return _propCache == null ? null : _propCache.get(); + } + + /** + * @return This property's property in compressed form. + */ + public SprmBuffer getSprmBuf() + { + return (SprmBuffer)_buf; + } + + +}