JTemporal Home
Tutorial

net.sf.jtemporal
Interface TimeSeries<V>

Type Parameters:
V - the type of the value
All Superinterfaces:
ReadableTemporalAttribute<V>
All Known Implementing Classes:
CachedTimeSeries

public interface TimeSeries<V>
extends ReadableTemporalAttribute<V>

This is more or less a Map, whose key is an Instant.
Warning, some more methods will be added later. especially given that for the moment no sorting-related methods are present (iterators, etc).

Version:
$Id: TimeSeries.java,v 1.8 2007/09/14 20:03:10 tabeck Exp $

Method Summary
 boolean containsInstant(Instant i)
          Returns true if this TimeSeries contains a mapping for the specified Instant.
 V get(Instant i)
          Gets the value currently associated to the i instant.
 V put(Instant i, V value)
          Creates a new entry in this timeseries.
 V remove(Instant i)
          Removes an entry from this timeseries.
 void remove(Period p)
          Remove a whole period from the timeseries (optional implementation).
 

Method Detail

put

V put(Instant i,
      V value)
Creates a new entry in this timeseries.

Parameters:
i - the instant whom the value must be associated to. Must be not null.
value - the value. Must be not null.
Returns:
the value previously associated to the i instant, or null.
Throws:
java.lang.UnsupportedOperationException - if the TimeSeries is read-only

get

V get(Instant i)
Gets the value currently associated to the i instant.

Specified by:
get in interface ReadableTemporalAttribute<V>
Parameters:
the - instant, key for this value.
Returns:
the value currently associated to the i instant, or null.

remove

V remove(Instant i)
Removes an entry from this timeseries.

Parameters:
i - the instant to be removed. Must be not null.
Returns:
the value that was previously associated to the i instant
Throws:
java.lang.UnsupportedOperationException - if the TimeSeries is read-only

remove

void remove(Period p)
Remove a whole period from the timeseries (optional implementation).

Parameters:
p - the period enclosing the entries to be removed.
Throws:
java.lang.UnsupportedOperationException - if the TimeSeries is read-only

containsInstant

boolean containsInstant(Instant i)
Returns true if this TimeSeries contains a mapping for the specified Instant.

Parameters:
i - instant whose presence in this TimeSeries is to be tested.
Returns:
true if this TimeSeries contains a mapping for the specified instant.

JTemporal Home
Tutorial