JTemporal Home
Tutorial

net.sf.jtemporal
Class WeakTimeSeriesFactory

java.lang.Object
  extended by net.sf.jtemporal.WeakTimeSeriesFactory

Deprecated.

public class WeakTimeSeriesFactory
extends java.lang.Object

Factory for timeseries.
The point is that timeseries values are internally stored in a WeakHashMap, in such a way that you can globally remove a date from the TimeSeriesMgr to free the memory of all the TimeSeries simultaenously, for the given date.
The advantage, is that this costly removal is done by the garbage collector and only if you need memory.
No strong references are held on the timeseries anymore: as soon you unreference them they are eligible for garbage collection. By moving the responsability to the gc, the code is quite simple, because we do not need to perform the old dates removal.

Version:
$Id: WeakTimeSeriesFactory.java,v 1.3 2004/05/02 15:51:00 tabeck Exp $

Constructor Summary
WeakTimeSeriesFactory()
          Deprecated.  
 
Method Summary
 TimeSeries getHashTimeSeries()
          Deprecated. Creates a new TimeSeries, internally linked to this mgr.
 TimeSeries getHashTimeSeries(MissingInstantHandler handler)
          Deprecated. Creates a new TimeSeries, internally linked to this mgr.
 void weaken(Instant i)
          Deprecated. Potentially removes the given instant in all the TimeSeries created by this mgr.
 void weaken(Period p)
          Deprecated. Potentially removes all the known instant in the given Period range, in all the TimeSeries created by this mgr.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WeakTimeSeriesFactory

public WeakTimeSeriesFactory()
Deprecated. 
Method Detail

getHashTimeSeries

public TimeSeries getHashTimeSeries()
Deprecated. 
Creates a new TimeSeries, internally linked to this mgr.
This internal link won't prevent the whole timeseries to be garbaged, if unreferenced.

Returns:
the new empty TimeSeries instance

getHashTimeSeries

public TimeSeries getHashTimeSeries(MissingInstantHandler handler)
Deprecated. 
Creates a new TimeSeries, internally linked to this mgr.
This internal link won't prevent the whole timeseries to be garbaged, if unreferenced.

Parameters:
handler - the handler used by the TimeSeries
Returns:
the new empty TimeSeries instance

weaken

public void weaken(Instant i)
Deprecated. 
Potentially removes the given instant in all the TimeSeries created by this mgr.
Actually, they will be removed by the garbage collector on a "as-needed" basis.
Reading a value in a timeseries for this instant, will automatically make it strong again.

Parameters:
i - the instant whose entries are to be removed from the timeseries.

weaken

public void weaken(Period p)
Deprecated. 
Potentially removes all the known instant in the given Period range, in all the TimeSeries created by this mgr.
Actually, they will be removed by the garbage collector on a "as-needed" basis.

Parameters:
p - the period defining the range of deletion

JTemporal Home
Tutorial