public final class IntervalShortMap extends IntervalMap<Short>
Constructor and Description |
---|
IntervalShortMap()
Default constructor.
|
IntervalShortMap(double[] keys,
short[] vals)
Constructor with an initial interval map.
|
IntervalShortMap(int capacity)
Constructor with capacity.
|
Modifier and Type | Method and Description |
---|---|
short |
getShort(Interval interval)
Get the value for the given interval.
|
short |
getShort(Interval interval,
short defaultValue)
Get the value for the given interval.
|
Class<Short> |
getTypeClass()
Returns the value type class.
|
boolean |
isSupported(Estimator estimator)
Returns whether
estimator is supported. |
short[] |
toShortArray()
Returns an array of all values in this map.
|
clear, contains, contains, equals, get, get, getIntervals, hashCode, isEmpty, put, remove, size, toKeysArray, toString, toString, toString, toValuesArray
public IntervalShortMap()
The map is empty with zero capacity.
public IntervalShortMap(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 IntervalShortMap(double[] keys, short[] vals)
The keys
array must be in the same format returned by
IntervalMap.getIntervals()
.
keys
- initial keys contentvals
- initial values contentpublic short getShort(Interval interval)
interval
- intervalIllegalArgumentException
- if the element doesn't existpublic short getShort(Interval interval, short defaultValue)
Return defaultValue
if the value is not found.
interval
- intervaldefaultValue
- default valuepublic short[] toShortArray()
This method may return a reference to the underlying array so clients should make a copy if the array is written to.
public Class<Short> getTypeClass()
TimeMap
Copyright © 2007–2015 Gephi Consortium. All rights reserved.