com.maxifier.mxcache.impl.caches.def.DoubleInlineCacheImpl Maven / Gradle / Ivy
/*
* Copyright (c) 2008-2014 Maxifier Ltd. All Rights Reserved.
*/
package com.maxifier.mxcache.impl.caches.def;
import com.maxifier.mxcache.caches.*;
import com.maxifier.mxcache.impl.MutableStatistics;
import com.maxifier.mxcache.impl.caches.abs.*;
/**
* THIS IS GENERATED CLASS! DON'T EDIT IT MANUALLY!
*
* GENERATED FROM PInlineCacheImpl.template
*
* @author Andrey Yakoushin ([email protected])
* @author Alexander Kochurov ([email protected])
*/
public class DoubleInlineCacheImpl extends AbstractDoubleCache {
private volatile boolean set;
private double value;
public DoubleInlineCacheImpl(Object owner, DoubleCalculatable calculable, MutableStatistics statistics) {
super(owner, calculable, statistics);
}
@Override
public boolean isCalculated() {
return set;
}
@Override
public double load() {
return value;
}
@Override
public void save(double v) {
set = true;
value = v;
}
@Override
public void clear() {
set = false;
}
@Override
public int size() {
return set ? 1 : 0;
}
}