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 void
clear()
Empties this map.boolean
contains(K key)
Returns true if this map contains the given key.V
get(K key, V defaultValue)
Get the value for the given key.Object
get(Interval interval, Estimator estimator)
Get the estimated value for the given interval.Class<V>
getTypeClass()
Returns the value type class.boolean
isEmpty()
Returns true if this map is empty.boolean
isSupported(Estimator estimator)
Returns whetherestimator
is supported.boolean
put(K key, V value)
Put the value at the given key.boolean
remove(K key)
Remove the value at the given key.int
size()
Returns the size.K[]
toKeysArray()
Returns all the keys as an array.String
toString(TimeFormat timeFormat)
Returns this map as a string.String
toString(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
defaultValue
if 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 whetherestimator
is 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
-
-