Examples of toNanos()


Examples of java.util.concurrent.TimeUnit.toNanos()

  public void testSetExpireAfterWrite() {
    long duration = 42;
    TimeUnit unit = TimeUnit.SECONDS;
    LocalCache<Object, Object> map =
        makeLocalCache(createCacheBuilder().expireAfterWrite(duration, unit));
    assertEquals(unit.toNanos(duration), map.expireAfterWriteNanos);
  }

  public void testSetExpireAfterAccess() {
    long duration = 42;
    TimeUnit unit = TimeUnit.SECONDS;
View Full Code Here

Examples of java.util.concurrent.TimeUnit.toNanos()

  public void testSetExpireAfterAccess() {
    long duration = 42;
    TimeUnit unit = TimeUnit.SECONDS;
    LocalCache<Object, Object> map =
        makeLocalCache(createCacheBuilder().expireAfterAccess(duration, unit));
    assertEquals(unit.toNanos(duration), map.expireAfterAccessNanos);
  }

  public void testSetRefresh() {
    long duration = 42;
    TimeUnit unit = TimeUnit.SECONDS;
View Full Code Here

Examples of java.util.concurrent.TimeUnit.toNanos()

  public void testSetRefresh() {
    long duration = 42;
    TimeUnit unit = TimeUnit.SECONDS;
    LocalCache<Object, Object> map =
        makeLocalCache(createCacheBuilder().refreshAfterWrite(duration, unit));
    assertEquals(unit.toNanos(duration), map.refreshNanos);
  }

  public void testSetRemovalListener() {
    RemovalListener<Object, Object> testListener = TestingRemovalListeners.nullRemovalListener();
    LocalCache<Object, Object> map =
View Full Code Here

Examples of java.util.concurrent.TimeUnit.toNanos()

  public void testSetExpireAfterWrite() {
    long duration = 42;
    TimeUnit unit = TimeUnit.SECONDS;
    LocalCache<Object, Object> map =
        makeLocalCache(createCacheBuilder().expireAfterWrite(duration, unit));
    assertEquals(unit.toNanos(duration), map.expireAfterWriteNanos);
  }

  public void testSetExpireAfterAccess() {
    long duration = 42;
    TimeUnit unit = TimeUnit.SECONDS;
View Full Code Here

Examples of java.util.concurrent.TimeUnit.toNanos()

  public void testSetExpireAfterAccess() {
    long duration = 42;
    TimeUnit unit = TimeUnit.SECONDS;
    LocalCache<Object, Object> map =
        makeLocalCache(createCacheBuilder().expireAfterAccess(duration, unit));
    assertEquals(unit.toNanos(duration), map.expireAfterAccessNanos);
  }

  public void testSetRefresh() {
    long duration = 42;
    TimeUnit unit = TimeUnit.SECONDS;
View Full Code Here

Examples of java.util.concurrent.TimeUnit.toNanos()

  public void testSetRefresh() {
    long duration = 42;
    TimeUnit unit = TimeUnit.SECONDS;
    LocalCache<Object, Object> map =
        makeLocalCache(createCacheBuilder().refreshAfterWrite(duration, unit));
    assertEquals(unit.toNanos(duration), map.refreshNanos);
  }

  public void testSetRemovalListener() {
    RemovalListener<Object, Object> testListener = TestingRemovalListeners.nullRemovalListener();
    LocalCache<Object, Object> map =
View Full Code Here

Examples of java.util.concurrent.TimeUnit.toNanos()

  public void testSetExpireAfterWrite() {
    long duration = 42;
    TimeUnit unit = SECONDS;
    MapMakerInternalMap<Object, Object> map =
        makeMap(createMapMaker().expireAfterWrite(duration, unit));
    assertEquals(unit.toNanos(duration), map.expireAfterWriteNanos);
  }

  public void testSetExpireAfterAccess() {
    long duration = 42;
    TimeUnit unit = SECONDS;
View Full Code Here

Examples of java.util.concurrent.TimeUnit.toNanos()

  public void testSetExpireAfterAccess() {
    long duration = 42;
    TimeUnit unit = SECONDS;
    MapMakerInternalMap<Object, Object> map =
        makeMap(createMapMaker().expireAfterAccess(duration, unit));
    assertEquals(unit.toNanos(duration), map.expireAfterAccessNanos);
  }

  public void testSetRemovalListener() {
    RemovalListener<Object, Object> testListener = new RemovalListener<Object, Object>() {
      @Override
View Full Code Here

Examples of java.util.concurrent.TimeUnit.toNanos()

         throw new IllegalArgumentException("No unit specified: " + string);
      }
      string = string.trim();
      try {
         long longValue = Long.parseLong(string);
         return timeUnit.toNanos(longValue);
      } catch (NumberFormatException e) {
         try {
            double doubleValue = Double.parseDouble(string);
            return timeUnit.toNanos((long) (doubleValue * 1000000)) / 1000000;
         } catch (NumberFormatException e2) {
View Full Code Here

Examples of java.util.concurrent.TimeUnit.toNanos()

         long longValue = Long.parseLong(string);
         return timeUnit.toNanos(longValue);
      } catch (NumberFormatException e) {
         try {
            double doubleValue = Double.parseDouble(string);
            return timeUnit.toNanos((long) (doubleValue * 1000000)) / 1000000;
         } catch (NumberFormatException e2) {
            throw new IllegalArgumentException("Cannot parse value: " + string, e);
         }
      }
   }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.