Returns a new CacheStats representing the difference between this CacheStats and other. Negative values, which aren't supported by CacheStats will be rounded up to zero.
(CacheStats other)
| 219 | * rounded up to zero. |
| 220 | */ |
| 221 | public CacheStats minus(CacheStats other) { |
| 222 | return new CacheStats( |
| 223 | Math.max(0, hitCount - other.hitCount), |
| 224 | Math.max(0, missCount - other.missCount), |
| 225 | Math.max(0, loadSuccessCount - other.loadSuccessCount), |
| 226 | Math.max(0, loadExceptionCount - other.loadExceptionCount), |
| 227 | Math.max(0, totalLoadTime - other.totalLoadTime), |
| 228 | Math.max(0, evictionCount - other.evictionCount)); |
| 229 | } |
| 230 | |
| 231 | /** |
| 232 | * Returns a new {@code CacheStats} representing the sum of this {@code CacheStats} and |