Package uk.gov.gchq.gaffer.time
Interface TimestampSet
-
- All Known Implementing Classes:
BoundedTimestampSet,RBMBackedTimestampSet
public interface TimestampSetThis represents a set of timestamps.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidadd(Instant instant)Adds the provided timestamp to the set.voidadd(Collection<Instant> instants)Adds all the provided timestamps to the set.InstantgetEarliest()The earliest timestamp in the set.InstantgetLatest()The latest timestamp in the set.longgetNumberOfTimestamps()Returns the number of distinct timestamps in the set.SortedSet<Instant>getTimestamps()Returns all the timestamps in the set, sorted in their natural order.
-
-
-
Method Detail
-
add
void add(Instant instant)
Adds the provided timestamp to the set.- Parameters:
instant- The timestamp to be added.
-
add
void add(Collection<Instant> instants)
Adds all the provided timestamps to the set.- Parameters:
instants- TheCollectionof timestamps to be added.
-
getTimestamps
SortedSet<Instant> getTimestamps()
Returns all the timestamps in the set, sorted in their natural order.- Returns:
- All the timestamps in the set, sorted in their natural order.
-
getNumberOfTimestamps
long getNumberOfTimestamps()
Returns the number of distinct timestamps in the set.- Returns:
- The number of distinct timestamps in the set.
-
getEarliest
Instant getEarliest()
The earliest timestamp in the set.- Returns:
- The earliest timestamp in the set.
-
getLatest
Instant getLatest()
The latest timestamp in the set.- Returns:
- The latest timestamp in the set.
-
-