@Override protected ZoieReaderContext clone() { ZoieReaderContext ctx = new ZoieReaderContext(); ctx._contextMap.putAll(_contextMap); return ctx; }
@SuppressWarnings("unchecked") public E get() { return (E) ZoieContext.getContext().getReaderContext(_reader).get(_key); } }
/** * clone the ZoieContext so that the internal hashmap is deep-copied to the * extend that in the clone, the ZoieReaderContexts are clones of the * original. Note that the internals of ZoieReaderContexts are shallow copies. * * @see java.lang.Object#clone() */ @Override protected ZoieContext clone() { ZoieContext ctx = new ZoieContext(); for (Entry<ZoieMultiReader<?>, ZoieReaderContext> pair : _zoieContextMap.entrySet()) { ctx._zoieContextMap.put(pair.getKey(), pair.getValue().clone()); } return ctx; }
public void set(E value) { ZoieContext.getContext().getReaderContext(_reader).set(_key, value); }
@SuppressWarnings("unchecked") public E get() { return (E) ZoieContext.getContext().getReaderContext(_reader).get(_key); } }
/** * clone the ZoieContext so that the internal hashmap is deep-copied to the * extend that in the clone, the ZoieReaderContexts are clones of the * original. Note that the internals of ZoieReaderContexts are shallow copies. * * @see java.lang.Object#clone() */ @Override protected ZoieContext clone() { ZoieContext ctx = new ZoieContext(); for (Entry<ZoieMultiReader<?>, ZoieReaderContext> pair : _zoieContextMap.entrySet()) { ctx._zoieContextMap.put(pair.getKey(), pair.getValue().clone()); } return ctx; }
public void set(E value) { ZoieContext.getContext().getReaderContext(_reader).set(_key, value); }
@Override protected ZoieReaderContext clone() { ZoieReaderContext ctx = new ZoieReaderContext(); ctx._contextMap.putAll(_contextMap); return ctx; } public static class ContextAccessor<E>
@SuppressWarnings("unchecked") public E get() { return (E) ZoieContext.getContext().getReaderContext(_reader).get(_key); } }
/** * clone the ZoieContext so that the internal hashmap is deep-copied to the * extend that in the clone, the ZoieReaderContexts are clones of the * original. Note that the internals of ZoieReaderContexts are shallow copies. * * @see java.lang.Object#clone() */ @Override protected ZoieContext clone() { ZoieContext ctx = new ZoieContext(); for (Entry<ZoieIndexReader<?>, ZoieReaderContext> pair : _zoieContextMap .entrySet()) { ctx._zoieContextMap.put(pair.getKey(), pair.getValue().clone()); } return ctx; }
public void set(E value) { ZoieContext.getContext().getReaderContext(_reader).set(_key, value); }
@Override protected ZoieReaderContext clone() { ZoieReaderContext ctx = new ZoieReaderContext(); ctx._contextMap.putAll(_contextMap); return ctx; }
/** * Get the context of the given reader for the calling thread. * * @param reader */ public synchronized ZoieReaderContext getReaderContext(ZoieMultiReader<?> reader) { ZoieReaderContext ctx = _zoieContextMap.get(reader); if (ctx == null) { ctx = new ZoieReaderContext(); _zoieContextMap.put(reader, ctx); } return ctx; }
/** * Get the context of the given reader for the calling thread. * * @param reader */ public synchronized ZoieReaderContext getReaderContext(ZoieMultiReader<?> reader) { ZoieReaderContext ctx = _zoieContextMap.get(reader); if (ctx == null) { ctx = new ZoieReaderContext(); _zoieContextMap.put(reader, ctx); } return ctx; }
/** * Get the context of the given reader for the calling thread. * * @param reader * @return */ public synchronized ZoieReaderContext getReaderContext( ZoieIndexReader<?> reader) { ZoieReaderContext ctx = _zoieContextMap.get(reader); if (ctx == null) { ctx = new ZoieReaderContext(); _zoieContextMap.put(reader, ctx); } return ctx; }