public final class TimestampDoubleMap extends TimestampMap<Double>
Constructor and Description |
---|
TimestampDoubleMap()
Default constructor.
|
TimestampDoubleMap(double[] keys,
double[] vals)
Constructor with an initial timestamp map.
|
TimestampDoubleMap(int capacity)
Constructor with capacity.
|
Modifier and Type | Method and Description |
---|---|
double |
getDouble(double timestamp)
Get the value for the given timestamp index.
|
double |
getDouble(double timestamp,
double defaultValue)
Get the value for the given timestamp index.
|
Class<Double> |
getTypeClass()
Returns the value type class.
|
boolean |
isSupported(Estimator estimator)
Returns whether
estimator is supported. |
double[] |
toDoubleArray()
Returns an array of all values in this map.
|
clear, contains, equals, get, get, getTimestamps, hashCode, isEmpty, put, remove, size, toKeysArray, toString, toString, toString, toValuesArray
public TimestampDoubleMap()
The map is empty with zero capacity.
public TimestampDoubleMap(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 TimestampDoubleMap(double[] keys, double[] vals)
The keys
array must be sorted and contain no duplicates.
keys
- initial keys contentvals
- initial values contentpublic double getDouble(double timestamp)
timestamp
- timestamp indexIllegalArgumentException
- if the element doesn't existpublic double getDouble(double timestamp, double defaultValue)
Return defaultValue
if the value is not found.
timestamp
- timestamp indexdefaultValue
- default valuepublic Class<Double> getTypeClass()
TimeMap
getTypeClass
in interface TimeMap<Double,Double>
getTypeClass
in class TimestampMap<Double>
public double[] toDoubleArray()
This method may return a reference to the underlying array so clients should make a copy if the array is written to.
public boolean isSupported(Estimator estimator)
TimeMap
estimator
is supported.isSupported
in interface TimeMap<Double,Double>
isSupported
in class TimestampMap<Double>
estimator
- estimatorestimator
Copyright © 2007–2017 Gephi Consortium. All rights reserved.