Package org.gephi.graph.api.types
Class TimestampSet
- java.lang.Object
-
- org.gephi.graph.api.types.TimestampSet
-
-
Constructor Summary
Constructors Constructor Description TimestampSet()
Default constructor.TimestampSet(double[] arr)
Constructor with an initial timestamp set.TimestampSet(int capacity)
Constructor with capacity.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
add(Double timestamp)
Adds key to this set.void
clear()
Empties this set.boolean
contains(Double timestamp)
Returns true if this set containskey
.boolean
equals(Object obj)
int
hashCode()
boolean
isEmpty()
Returns true if this set is empty.boolean
remove(Double timestamp)
Removes key from this set.int
size()
Returns the size of this set.Double[]
toArray()
Returns an array of all keys in this set.double[]
toPrimitiveArray()
Returns the same result asTimeSet.toArray()
but in a primitive array if the underlying storage is in a primtive form.String
toString()
String
toString(TimeFormat timeFormat)
Returns this set as a string.String
toString(TimeFormat timeFormat, DateTimeZone timeZone)
Returns this set as a string.
-
-
-
Constructor Detail
-
TimestampSet
public TimestampSet()
Default constructor.The set is empty with zero capacity.
-
TimestampSet
public TimestampSet(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
-
TimestampSet
public TimestampSet(double[] arr)
Constructor with an initial timestamp set.The given array must be sorted and contain no duplicates.
- Parameters:
arr
- initial set content
-
-
Method Detail
-
add
public boolean add(Double timestamp)
Description copied from interface:TimeSet
Adds key to this set.
-
remove
public boolean remove(Double timestamp)
Description copied from interface:TimeSet
Removes key from this set.
-
size
public int size()
Description copied from interface:TimeSet
Returns the size of this set.
-
isEmpty
public boolean isEmpty()
Description copied from interface:TimeSet
Returns true if this set is empty.
-
contains
public boolean contains(Double timestamp)
Description copied from interface:TimeSet
Returns true if this set containskey
.
-
toArray
public Double[] toArray()
Description copied from interface:TimeSet
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.
-
toPrimitiveArray
public double[] toPrimitiveArray()
Description copied from interface:TimeSet
Returns the same result asTimeSet.toArray()
but in a primitive array if the underlying storage is in a primtive form.- Specified by:
toPrimitiveArray
in interfaceTimeSet<Double>
- Returns:
- array of all keys
-
clear
public void clear()
Description copied from interface:TimeSet
Empties this set.
-
toString
public String toString(TimeFormat timeFormat, DateTimeZone timeZone)
Description copied from interface:TimeSet
Returns this set as a string.
-
toString
public String toString(TimeFormat timeFormat)
Description copied from interface:TimeSet
Returns this set as a string.
-
-