@Override
	public void removeExpired()
	{
		if (timeToExpire == 0 || !(map instanceof LinkedHashMap))
			return;
		final long now = System.currentTimeMillis();
		final long duration = timeToExpire * 1000L;
		CacheObject o = null;
		synchronized (this) {
			for (final Iterator<CacheObject> i = map.values().iterator(); i.hasNext();) {
				o = i.next();
				if (now >= o.getTimestamp() + duration) {
					i.remove();
					notifyRemoved(o);
				}
				else
					break;
			}
		}
	}
@ Override public void removeExpired ( ) { if ( timeToExpire == 0 || ! ( map instanceof LinkedHashMap ) ) return ; final long now = System . currentTimeMillis ( ) ; final long duration = timeToExpire * 1000L ; CacheObject o = null ; synchronized ( this ) { for ( final Iterator < CacheObject > i = map . values ( ) . iterator ( ) ; i . hasNext ( ) ; ) { o = i . next ( ) ; if ( now >= o . getTimestamp ( ) + duration ) { i . remove ( ) ; notifyRemoved ( o ) ; } else break ; } } }
Removes all {@link CacheObject}s, where<br>
<code>{@link CacheObject#getTimestamp()} + timeToExpire &lt;= now</code>, with
<code>timeToExpire &gt; 0</code> and <code>now</code> is the point of time
{@link #removeExpired()} is invoked. <br>
If no expiring time was specified at creation of cache, no cache object will be
expired.