T - Value typepublic abstract class TimestampMap<T> extends Object implements TimeMap<Double,T>
Implementations which extend this class customize the map for a unique type,
which is represented by the T parameter.
| Constructor and Description |
|---|
TimestampMap()
Default constructor.
|
TimestampMap(int capacity)
Constructor with capacity.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Empties this map.
|
boolean |
contains(Double timestamp)
Returns true if this map contains the given key.
|
boolean |
equals(Object obj) |
T |
get(Double timestamp,
T defaultValue)
Get the value for the given key.
|
Object |
get(Interval interval,
Estimator estimator)
Get the estimated value for the given interval.
|
double[] |
getTimestamps()
Returns an array of all timestamps in this map.
|
abstract Class<T> |
getTypeClass()
Returns the value type class.
|
int |
hashCode() |
boolean |
isEmpty()
Returns true if this map is empty.
|
abstract boolean |
isSupported(Estimator estimator)
Returns whether
estimator is supported. |
boolean |
put(Double timestamp,
T value)
Put the value at the given key.
|
boolean |
remove(Double timestamp)
Remove the value at the given key.
|
int |
size()
Returns the size.
|
Double[] |
toKeysArray()
Returns all the keys as an array.
|
String |
toString() |
String |
toString(TimeFormat timeFormat) |
String |
toString(TimeFormat timeFormat,
org.joda.time.DateTimeZone timeZone) |
T[] |
toValuesArray()
Returns all the values as an array.
|
public TimestampMap()
The map is empty with zero capacity.
public TimestampMap(int capacity)
Using this constructor can improve performances if the number of timestamps is known in advance as it minimizes array resizes.
capacity - timestamp capacitypublic boolean put(Double timestamp, T value)
TimeMappublic boolean remove(Double timestamp)
TimeMappublic T get(Double timestamp, T defaultValue)
TimeMap
Return defaultValue if the value is not found.
public Object get(Interval interval, Estimator estimator)
TimeMapThe estimator is used to determine the way multiple interval values are merged together (e.g average, first, median).
public T[] toValuesArray()
TimeMaptoValuesArray in interface TimeMap<Double,T>public abstract Class<T> getTypeClass()
TimeMapgetTypeClass in interface TimeMap<Double,T>public abstract boolean isSupported(Estimator estimator)
TimeMapestimator is supported.isSupported in interface TimeMap<Double,T>estimator - estimatorestimatorpublic int size()
TimeMappublic boolean isEmpty()
TimeMappublic boolean contains(Double timestamp)
TimeMappublic double[] getTimestamps()
This method may return a reference to the underlying array so clients should make a copy if the array is written to.
public Double[] toKeysArray()
TimeMaptoKeysArray in interface TimeMap<Double,T>public void clear()
TimeMappublic String toString(TimeFormat timeFormat, org.joda.time.DateTimeZone timeZone)
public String toString(TimeFormat timeFormat)
Copyright © 2007–2015 Gephi Consortium. All rights reserved.