A
- the activity typepublic class IntervalTree<A extends Activity> extends Object
IntervalTreeActivityRepository
Constructor and Description |
---|
IntervalTree() |
Modifier and Type | Method and Description |
---|---|
boolean |
add(A activity)
Adds an activity to the tree.
|
void |
clear()
Removes all activities from the tree.
|
Instant |
getEarliestTimeUsed()
Returns the earliest time used by all activities currently stored inside
the tree.
|
Collection<A> |
getIntersectingObjects(long start,
long end)
Returns all activities found within the given time interval.
|
Collection<A> |
getIntersectingObjects(TimeInterval interval)
Returns all activities found within the given time interval.
|
Instant |
getLatestTimeUsed()
Returns the latest time used by all activities currently stored inside
the tree.
|
boolean |
remove(A activity)
Method to remove period/key object from tree.
|
boolean |
removeIf(Predicate<A> predicate) |
Collection<A> |
removePeriod(TimeInterval interval)
Removes all activities found within the given time interval.
|
long |
size()
Returns the number of activities stored inside the tree.
|
public final Instant getEarliestTimeUsed()
public final Instant getLatestTimeUsed()
public final boolean add(A activity)
activity
- the activity to addpublic final boolean remove(A activity)
activity
- the activity to removepublic final Collection<A> removePeriod(TimeInterval interval)
interval
- the time intervalpublic final Collection<A> getIntersectingObjects(TimeInterval interval)
interval
- the time intervalpublic final Collection<A> getIntersectingObjects(long start, long end)
start
- the time interval startend
- the time interval endpublic final long size()
public final void clear()
Copyright © 2020 Dirk Lemmermann Software & Consulting. All rights reserved.