Package java.util.concurrent.atomic

Examples of java.util.concurrent.atomic.AtomicLongArray


    final AtomicLongArray buckets;

    public EstimatedHistogram()
    {
        buckets = new AtomicLongArray(numBuckets);
    }
View Full Code Here


   * with all elements initially zero.
   *
   * @param length the length of the array
   */
  public AtomicDoubleArray(int length) {
    this.longs = new AtomicLongArray(length);
  }
View Full Code Here

    final int len = array.length;
    long[] longArray = new long[len];
    for (int i = 0; i < len; i++) {
      longArray[i] = doubleToRawLongBits(array[i]);
    }
    this.longs = new AtomicLongArray(longArray);
  }
View Full Code Here

      throws java.io.IOException, ClassNotFoundException {
    s.defaultReadObject();

    // Read in array length and allocate array
    int length = s.readInt();
    this.longs = new AtomicLongArray(length);

    // Read in all elements in the proper order.
    for (int i = 0; i < length; i++) {
      set(i, s.readDouble());
    }
View Full Code Here

    private final long[]          ranges;
    private final AtomicLongArray rangeCounters;

    public Histogram(long... ranges){
        this.ranges = ranges;
        this.rangeCounters = new AtomicLongArray(ranges.length + 1);
    }
View Full Code Here

        this.ranges = new long[ranges.length];
        for (int i = 0; i < ranges.length; i++) {
            this.ranges[i] = TimeUnit.MILLISECONDS.convert(ranges[i], timeUnit);
        }

        rangeCounters = new AtomicLongArray(ranges.length + 1);
    }
View Full Code Here

     * Creates a new {@link UniformReservoir}.
     *
     * @param size the number of samples to keep in the sampling reservoir
     */
    public UniformReservoir(int size) {
        this.values = new AtomicLongArray(size);
        for (int i = 0; i < values.length(); i++) {
            values.set(i, 0);
        }
        count.set(0);
    }
View Full Code Here

       
        if (type == AtomicLongArray.class) {
            JSONArray array = new JSONArray();
            parser.parseArray(array);

            AtomicLongArray atomicArray = new AtomicLongArray(array.size());
            for (int i = 0; i < array.size(); ++i) {
                atomicArray.set(i, array.getLong(i));
            }

            return (T) atomicArray;
        }
View Full Code Here

        }

        JSONArray array = new JSONArray();
        parser.parseArray(array);

        AtomicLongArray atomicArray = new AtomicLongArray(array.size());
        for (int i = 0; i < array.size(); ++i) {
            atomicArray.set(i, array.getLong(i));
        }

        return (T) atomicArray;
    }
View Full Code Here

    private final long[]          ranges;
    private final AtomicLongArray rangeCounters;

    public Histogram(long... ranges){
        this.ranges = ranges;
        this.rangeCounters = new AtomicLongArray(ranges.length + 1);
    }
View Full Code Here

TOP

Related Classes of java.util.concurrent.atomic.AtomicLongArray

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.