Package org.gephi.graph.api.types
Interface TimeSet<K>
-
- Type Parameters:
K
- key type
- All Known Implementing Classes:
IntervalSet
,TimestampSet
public interface TimeSet<K>
Interface that defines the functionalities both timestamp and interval set have.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
add(K key)
Adds key to this set.void
clear()
Empties this set.boolean
contains(K key)
Returns true if this set containskey
.K
getMax()
Returns the maximum key in the setDouble
getMaxDouble()
Returns the maximum timestamp in the setK
getMin()
Returns the minimum key in the setDouble
getMinDouble()
Returns the minimum timestamp in the setboolean
isEmpty()
Returns true if this set is empty.boolean
remove(K key)
Removes key from this set.int
size()
Returns the size of this set.K[]
toArray()
Returns an array of all keys in this set.Object
toPrimitiveArray()
Returns the same result astoArray()
but in a primitive array if the underlying storage is in a primitive form.String
toString(TimeFormat timeFormat)
Returns this set as a string.String
toString(TimeFormat timeFormat, org.joda.time.DateTimeZone timeZone)
Returns this set as a string.
-
-
-
Method Detail
-
add
boolean add(K key)
Adds key to this set.- Parameters:
key
- key- Returns:
- true if added, false otherwise
-
remove
boolean remove(K key)
Removes key from this set.- Parameters:
key
- key- Returns:
- true if removed, false otherwise
-
size
int size()
Returns the size of this set.- Returns:
- the number of elements in this set
-
isEmpty
boolean isEmpty()
Returns true if this set is empty.- Returns:
- true if empty, false otherwise
-
contains
boolean contains(K key)
Returns true if this set containskey
.- Parameters:
key
- key- Returns:
- true if contains, false otherwise
-
getMin
K getMin()
Returns the minimum key in the set- Returns:
- minimum key, or null if the set is empty.
-
getMax
K getMax()
Returns the maximum key in the set- Returns:
- maximum key, or null if the set is empty.
-
getMinDouble
Double getMinDouble()
Returns the minimum timestamp in the set- Returns:
- minimum timestamp, or null if the set is empty.
-
getMaxDouble
Double getMaxDouble()
Returns the maximum timestamp in the set- Returns:
- maximum timestamp, or null if the set is empty.
-
toArray
K[] toArray()
Returns an array of all keys in this set.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 keys
-
toPrimitiveArray
Object toPrimitiveArray()
Returns the same result astoArray()
but in a primitive array if the underlying storage is in a primitive form.- Returns:
- array of all keys
-
clear
void clear()
Empties this set.
-
toString
String toString(TimeFormat timeFormat)
Returns this set as a string.- Parameters:
timeFormat
- time format- Returns:
- set as string
-
toString
String toString(TimeFormat timeFormat, org.joda.time.DateTimeZone timeZone)
Returns this set as a string.- Parameters:
timeFormat
- time formattimeZone
- time zone- Returns:
- set as string
-
-