Package org.gephi.graph.api.types
Class TimestampCharMap
- java.lang.Object
-
- org.gephi.graph.api.types.TimestampMap<Character>
-
- org.gephi.graph.api.types.TimestampCharMap
-
public final class TimestampCharMap extends TimestampMap<Character>
Sorted map where keys are timestamp and values character values.
-
-
Constructor Summary
Constructors Constructor Description TimestampCharMap()Default constructor.TimestampCharMap(double[] keys, char[] vals)Constructor with an initial timestamp map.TimestampCharMap(int capacity)Constructor with capacity.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description chargetCharacter(double timestamp)Get the value for the given timestamp.chargetCharacter(double timestamp, char defaultValue)Get the value for the given timestamp.Class<Character>getTypeClass()Returns the value type class.booleanisSupported(Estimator estimator)Returns whetherestimatoris supported.char[]toCharacterArray()Returns an array of all values in this map.-
Methods inherited from class org.gephi.graph.api.types.TimestampMap
clear, contains, equals, get, get, getTimestamps, hashCode, isEmpty, put, remove, size, toKeysArray, toString, toString, toString, toValuesArray
-
-
-
-
Constructor Detail
-
TimestampCharMap
public TimestampCharMap()
Default constructor.The map is empty with zero capacity.
-
TimestampCharMap
public TimestampCharMap(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
-
TimestampCharMap
public TimestampCharMap(double[] keys, char[] vals)Constructor with an initial timestamp map.The
keysarray must be sorted and contain no duplicates.- Parameters:
keys- initial keys contentvals- initial values content
-
-
Method Detail
-
getCharacter
public char getCharacter(double timestamp)
Get the value for the given timestamp.- Parameters:
timestamp- timestamp- Returns:
- found value or the default value if not found
- Throws:
IllegalArgumentException- if the element doesn't exist
-
getCharacter
public char getCharacter(double timestamp, char defaultValue)Get the value for the given timestamp.Return
defaultValueif the value is not found.- Parameters:
timestamp- timestampdefaultValue- default value- Returns:
- found value or the default value if not found
-
getTypeClass
public Class<Character> getTypeClass()
Description copied from interface:TimeMapReturns the value type class.- Specified by:
getTypeClassin interfaceTimeMap<Double,Character>- Specified by:
getTypeClassin classTimestampMap<Character>- Returns:
- type class
-
toCharacterArray
public char[] toCharacterArray()
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
-
isSupported
public boolean isSupported(Estimator estimator)
Description copied from interface:TimeMapReturns whetherestimatoris supported.- Specified by:
isSupportedin interfaceTimeMap<Double,Character>- Specified by:
isSupportedin classTimestampMap<Character>- Parameters:
estimator- estimator- Returns:
- true if this map supports
estimator
-
-