Package org.gephi.graph.api.types
Class IntervalFloatMap
- java.lang.Object
-
- org.gephi.graph.api.types.IntervalMap<Float>
-
- org.gephi.graph.api.types.IntervalFloatMap
-
public final class IntervalFloatMap extends IntervalMap<Float>
Sorted map where keys are intervals and values float values.
-
-
Constructor Summary
Constructors Constructor Description IntervalFloatMap()Default constructor.IntervalFloatMap(double[] keys, float[] vals)Constructor with an initial interval map.IntervalFloatMap(int capacity)Constructor with capacity.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description floatgetFloat(Interval interval)Get the value for the given interval.floatgetFloat(Interval interval, float defaultValue)Get the value for the given interval.Class<Float>getTypeClass()Returns the value type class.booleanisSupported(Estimator estimator)Returns whetherestimatoris supported.float[]toFloatArray()Returns an array of all values in this map.-
Methods inherited from class org.gephi.graph.api.types.IntervalMap
clear, contains, contains, equals, get, get, getIntervals, hashCode, isEmpty, put, remove, size, toKeysArray, toString, toString, toString, toValuesArray
-
-
-
-
Constructor Detail
-
IntervalFloatMap
public IntervalFloatMap()
Default constructor.The map is empty with zero capacity.
-
IntervalFloatMap
public IntervalFloatMap(int capacity)
Constructor with capacity.Using this constructor can improve performances if the number of timestamps is known in advance as it minimizes array resizes.
- Parameters:
capacity- timestamp capacity
-
IntervalFloatMap
public IntervalFloatMap(double[] keys, float[] vals)Constructor with an initial interval map.The
keysarray must be in the same format returned byIntervalMap.getIntervals().- Parameters:
keys- initial keys contentvals- initial values content
-
-
Method Detail
-
getFloat
public float getFloat(Interval interval)
Get the value for the given interval.- Parameters:
interval- interval- Returns:
- found value or the default value if not found
- Throws:
IllegalArgumentException- if the element doesn't exist
-
getFloat
public float getFloat(Interval interval, float defaultValue)
Get the value for the given interval.Return
defaultValueif the value is not found.- Parameters:
interval- intervaldefaultValue- default value- Returns:
- found value or the default value if not found
-
toFloatArray
public float[] toFloatArray()
Returns an array of all values in this map.This method may return a reference to the underlying array so clients should make a copy if the array is written to.
- Returns:
- array of all values
-
getTypeClass
public Class<Float> getTypeClass()
Description copied from interface:TimeMapReturns the value type class.- Returns:
- type class
-
-