Package org.gephi.graph.api.types
Interface TimeMap<K,V>
-
- Type Parameters:
K- key typeV- value type
- All Known Implementing Classes:
IntervalBooleanMap,IntervalByteMap,IntervalCharMap,IntervalDoubleMap,IntervalFloatMap,IntervalIntegerMap,IntervalLongMap,IntervalMap,IntervalShortMap,IntervalStringMap,TimestampBooleanMap,TimestampByteMap,TimestampCharMap,TimestampDoubleMap,TimestampFloatMap,TimestampIntegerMap,TimestampLongMap,TimestampMap,TimestampShortMap,TimestampStringMap
public interface TimeMap<K,V>Interface that defines the functionalities both timestamp and interval map have.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidclear()Empties this map.booleancontains(K key)Returns true if this map contains the given key.Vget(K key, V defaultValue)Get the value for the given key.Objectget(Interval interval, Estimator estimator)Get the estimated value for the given interval.Class<V>getTypeClass()Returns the value type class.booleanisEmpty()Returns true if this map is empty.booleanisSupported(Estimator estimator)Returns whetherestimatoris supported.booleanput(K key, V value)Put the value at the given key.booleanremove(K key)Remove the value at the given key.intsize()Returns the size.K[]toKeysArray()Returns all the keys as an array.StringtoString(TimeFormat timeFormat)Returns this map as a string.StringtoString(TimeFormat timeFormat, org.joda.time.DateTimeZone timeZone)Returns this map as a string.V[]toValuesArray()Returns all the values as an array.
-
-
-
Method Detail
-
put
boolean put(K key, V value)
Put the value at the given key.- Parameters:
key- keyvalue- value- Returns:
- true if key is a new key, false otherwise
-
remove
boolean remove(K key)
Remove the value at the given key.- Parameters:
key- key- Returns:
- true if the key existed, false otherwise
-
get
Object get(Interval interval, Estimator estimator)
Get the estimated value for the given interval.The estimator is used to determine the way multiple interval values are merged together (e.g average, first, median).
- Parameters:
interval- interval queryestimator- estimator used- Returns:
- estimated value
-
get
V get(K key, V defaultValue)
Get the value for the given key.Return
defaultValueif the value is not found.- Parameters:
key- keydefaultValue- default value- Returns:
- found value or the default value if not found
-
toValuesArray
V[] toValuesArray()
Returns all the values as an array.- Returns:
- values array
-
toKeysArray
K[] toKeysArray()
Returns all the keys as an array.- Returns:
- keys array
-
contains
boolean contains(K key)
Returns true if this map contains the given key.- Parameters:
key- key- Returns:
- true if contains, false otherwise
-
clear
void clear()
Empties this map.
-
isSupported
boolean isSupported(Estimator estimator)
Returns whetherestimatoris supported.- Parameters:
estimator- estimator- Returns:
- true if this map supports
estimator
-
size
int size()
Returns the size.- Returns:
- the number of elements in this map
-
isEmpty
boolean isEmpty()
Returns true if this map is empty.- Returns:
- true if empty, false otherwise
-
toString
String toString(TimeFormat timeFormat)
Returns this map as a string.- Parameters:
timeFormat- time format- Returns:
- map as string
-
toString
String toString(TimeFormat timeFormat, org.joda.time.DateTimeZone timeZone)
Returns this map as a string.- Parameters:
timeFormat- time formattimeZone- time zone- Returns:
- map as string
-
-