Code example for AtomicLong

Methods: longValue

0
        public long accessCount() { 
            return accessCount.get();
        } 
 
        public long lastAccessed() { 
            return lastAccess.longValue();
        } 
 
        public void updateLastAccessTime() { 
            accessCount.incrementAndGet();
            lastAccess.set(System.currentTimeMillis());
        } 
         
        public int compareTo(Entry entry) {
            return (int)(expiresAt - entry.expiresAt());
        } 
    } 
 
    protected AbstractCache(CacheBuilder builder) {
        setDefaultExpiration(builder.getDefaultExpirationInMillis());
    }