snaq.util
Class TimeWrapper<E>

java.lang.Object
  extended by snaq.util.TimeWrapper<E>

public class TimeWrapper<E>
extends Object

Time-tracking wrapper class for an object.

Author:
Giles Winstanley
See Also:
ObjectPool

Constructor Summary
TimeWrapper(E obj, long expiryTime)
          Creates a new wrapped object.
 
Method Summary
 E getObject()
          Returns the object referenced by this wrapper.
 boolean isExpired()
          Whether this item has expired.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TimeWrapper

public TimeWrapper(E obj,
                   long expiryTime)
Creates a new wrapped object.

Parameters:
obj - object to be referenced
expiryTime - object's idle time before death in milliseconds (0 - eternal)
Method Detail

getObject

public E getObject()
Returns the object referenced by this wrapper.


isExpired

public boolean isExpired()
Whether this item has expired. (Expiry of zero indicates that it will never expire.)