Constructor and Description |
---|
TimestampSet()
Default constructor.
|
TimestampSet(double[] arr)
Constructor with an initial timestamp set.
|
TimestampSet(int capacity)
Constructor with capacity.
|
Modifier and Type | Method and Description |
---|---|
boolean |
add(Double timestamp)
Adds key to this set.
|
void |
clear()
Empties this set.
|
boolean |
contains(Double timestamp)
Returns true if this set contains
key . |
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 as
TimeSet.toArray() but in a primitive array
if the underlying storage is in a primtive form. |
String |
toString() |
String |
toString(TimeFormat timeFormat) |
String |
toString(TimeFormat timeFormat,
org.joda.time.DateTimeZone timeZone) |
public TimestampSet()
The set is empty with zero capacity.
public TimestampSet(int capacity)
Using this constructor can improve performances if the number of timestamps is known in advance as it minimizes array resizes.
capacity
- timestamp capacitypublic TimestampSet(double[] arr)
The given array must be sorted and contain no duplicates.
arr
- initial set contentpublic boolean add(Double timestamp)
TimeSet
public boolean remove(Double timestamp)
TimeSet
public int size()
TimeSet
public boolean isEmpty()
TimeSet
public boolean contains(Double timestamp)
TimeSet
key
.public Double[] toArray()
TimeSet
This method may return a reference to the underlying array so clients should make a copy if the array is written to.
public double[] toPrimitiveArray()
TimeSet
TimeSet.toArray()
but in a primitive array
if the underlying storage is in a primtive form.toPrimitiveArray
in interface TimeSet<Double>
public void clear()
TimeSet
public String toString(TimeFormat timeFormat, org.joda.time.DateTimeZone timeZone)
public String toString(TimeFormat timeFormat)
Copyright © 2007–2015 Gephi Consortium. All rights reserved.