1 19 20 package org.netbeans.modules.web.core.jsploader; 21 22 26 public class TimeReference { 27 28 private Object value; 29 private long timestamp; 30 31 32 public TimeReference() { 33 value = null; 34 timestamp = -1; 35 } 36 37 40 public synchronized Object get(long currentTimestamp) { 41 if (currentTimestamp > timestamp) { 42 value = null; 44 } 45 return value; 46 } 47 48 52 public synchronized void put(Object value, long newTimestamp) { 53 if (newTimestamp > timestamp) { 54 this.timestamp = newTimestamp; 55 this.value = value; 56 } 57 } 58 59 } 60 | Popular Tags |