A
- the type of the activitiespublic class ListActivityRepository<A extends Activity> extends MutableActivityRepositoryBase<A>
Modifier and Type | Class and Description |
---|---|
static class |
ListActivityRepository.IteratorType
A list of possible iterators that the repository can return when the
application queries the repository for the activities within a given
time interval.
|
Constructor and Description |
---|
ListActivityRepository()
Constructs a new repository that returns a binary iterator when the
application queries the repository for the activities within a specific
time interval.
|
ListActivityRepository(ListActivityRepository.IteratorType iteratorType)
Constructs a new repository that returns an iterator of the specified type
when the application queries the repository for the activities within a specific
time interval.
|
Modifier and Type | Method and Description |
---|---|
void |
addActivity(ActivityRef<A> activityRef)
Adds the given activity to the repository.
|
void |
clearActivities()
Removes all activities from all layers from the repository.
|
void |
clearActivities(Layer layer)
Removes the activities on the given layer from the repository.
|
Iterator<A> |
getActivities(Layer layer,
Instant startTime,
Instant endTime,
TemporalUnit temporalUnit,
ZoneId zoneId)
Returns an iterator for iterating over all activities found for the given
layer and time interval.
|
List<A> |
getAllActivities()
Returns all activities on all layers.
|
Instant |
getEarliestTimeUsed()
Returns the earliest time used by the activities stored in this
repository / on this row.
|
ListActivityRepository.IteratorType |
getIteratorType()
Returns the iterator type that is being returned by the repository.
|
Instant |
getLatestTimeUsed()
Returns the latest time used by the activities stored in this repository
/ on this row.
|
void |
removeActivity(ActivityRef<A> activityRef)
Removes the given activity from the repository.
|
void |
setIteratorType(ListActivityRepository.IteratorType iteratorType)
Sets a different iterator type on this repository.
|
addEventHandler, buildEventDispatchChain, fireEvent, removeEventHandler
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addEventHandler, removeEventHandler
public ListActivityRepository()
ListActivityRepository.IteratorType.BINARY_ITERATOR
public ListActivityRepository(ListActivityRepository.IteratorType iteratorType)
public final ListActivityRepository.IteratorType getIteratorType()
public final void setIteratorType(ListActivityRepository.IteratorType iteratorType)
iteratorType
- the new iterator typepublic final Iterator<A> getActivities(Layer layer, Instant startTime, Instant endTime, TemporalUnit temporalUnit, ZoneId zoneId)
ActivityRepository
layer
- the layer for which to return the activitiesstartTime
- the start time of the time interval for which to return the
activitiesendTime
- the end time of the time interval for which to return the
activitiestemporalUnit
- the temporal unit currently displayed in the datelinezoneId
- the timezone currently displayed in the datelinepublic final void addActivity(ActivityRef<A> activityRef)
MutableActivityRepository
activityRef
- the activitypublic final void removeActivity(ActivityRef<A> activityRef)
MutableActivityRepository
activityRef
- the activitypublic final void clearActivities()
MutableActivityRepository
public final void clearActivities(Layer layer)
MutableActivityRepository
layer
- the layer to clearpublic final Instant getEarliestTimeUsed()
ActivityRepository
getEarliestTimeUsed
in interface ActivityRepository<A extends Activity>
getEarliestTimeUsed
in class ActivityRepositoryBase<A extends Activity>
public final Instant getLatestTimeUsed()
ActivityRepository
getLatestTimeUsed
in interface ActivityRepository<A extends Activity>
getLatestTimeUsed
in class ActivityRepositoryBase<A extends Activity>
Copyright © 2020 Dirk Lemmermann Software & Consulting. All rights reserved.