jersey.repackaged.jsr166e.LongAdderTable Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jersey-jsr166e Show documentation
Show all versions of jersey-jsr166e Show documentation
Jersey JSR-166e Repackaged. See http://gee.cs.oswego.edu/dl/concurrency-interest/index.html
/*
* Written by Doug Lea with assistance from members of JCP JSR-166
* Expert Group and released to the public domain, as explained at
* http://creativecommons.org/publicdomain/zero/1.0/
*/
package jersey.repackaged.jsr166e;
import java.util.Map;
import java.util.Set;
import java.io.Serializable;
/**
* A keyed table of adders, that may be useful in computing frequency
* counts and histograms, or may be used as a form of multiset. A
* {@link LongAdder} is associated with each key. Keys are added to
* the table implicitly upon any attempt to update, or may be added
* explicitly using method {@link #install}.
*
* jsr166e note: This class is targeted to be placed in
* java.util.concurrent.atomic.
*
* @since 1.8
* @author Doug Lea
*/
public class LongAdderTable implements Serializable {
/** Relies on default serialization */
private static final long serialVersionUID = 7249369246863182397L;
/** The underlying map */
private final ConcurrentHashMapV8 map;
static final class CreateAdder
implements ConcurrentHashMapV8.Fun