AtomicDouble set - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for AtomicDouble set method.

This code example shows how to use the following methods:set
    public float getCurrentActivityProgress() { 
        return (float) currentProgress.get();
    } 
 
    public void setCurrentProgress(float currentProgress) {
        this.currentProgress.set(currentProgress);
    } 
 
    @Override 
    public synchronized String getErrorMessage() {
        return errorMessage;
    } 
 
    public synchronized void setErrorMessage(String errorMessage) {
        this.errorMessage = errorMessage;
        status = Status.FAILED; 
    } 
 
    public synchronized void setComplete() { 
        status = Status.COMPLETE; 
5
CodeRank
This code example shows how to use the following methods:get, set
        private final AtomicDouble average = new AtomicDouble();
 
        synchronized void add(long value)
        { 
            count++;
            double oldAverage = average.get();
            average.set(oldAverage + ((value - oldAverage) / count));
        } 
 
        double get() 
        { 
            return average.get();
        } 
    } 
} 
5
CodeRank
This code example shows how to use the following methods:set
 
    /** 
     * Set the current value. 
     */ 
    public void set(Double n) {
        number.set(n);
    } 
 
    /** 
     * Returns a reference to the {@link com.google.common.util.concurrent.AtomicDouble}. 
     */ 
    public AtomicDouble getNumber() {
        return number;
    } 
 
    /** 
     * {@inheritDoc} 
     */ 
    @Override 
    public boolean equals(Object o) { 
5
CodeRank
This code example shows how to use the following methods:get, set
        { 
            public boolean process(Node node)
            { 
 
                while (iterator.hasNext() && iterator.peek() <= node.getUpperBound()) {
                    double bucketCount = sum.get() - lastSum.get();
 
                    Bucket bucket = new Bucket(bucketCount / normalizationFactor, bucketWeightedSum.get() / bucketCount);
 
                    builder.add(bucket);
                    lastSum.set(sum.get());
                    bucketWeightedSum.set(0);
                    iterator.next();
                } 
 
                bucketWeightedSum.addAndGet(node.getMiddle() * node.weightedCount);
                sum.addAndGet(node.weightedCount);
                return iterator.hasNext();
            } 
        }); 
4
CodeRank
set Method Overview
Sets to the given value.
See Code Examples for other Guava AtomicDouble Methods: