Class FitnessDatabase
java.lang.Object
yearreview.app.data.sources.fitness.databse.FitnessDatabase
A Database that stores
Activities
sorted by their starting times.
The Database also allows for iteration of Activities by their starting time.- Author:
- ColdStone37
-
Field Summary
Modifier and TypeFieldDescriptionA Set that stores allActivities
by sorted by their starting times. -
Constructor Summary
ConstructorDescriptionDefault Constructor for a FitnessDatabase that initializes the Set used for storing theActivities
. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Inserts an Activity into the Database.iterator()
Returns an iterator for the Database that provides the Activities sorted by their starting time.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
activities
A Set that stores allActivities
by sorted by their starting times.
-
-
Constructor Details
-
FitnessDatabase
public FitnessDatabase()Default Constructor for a FitnessDatabase that initializes the Set used for storing theActivities
.
-
-
Method Details
-
insertActivity
Inserts an Activity into the Database.- Parameters:
a
- Activity to insert
-
iterator
Returns an iterator for the Database that provides the Activities sorted by their starting time. Needed to implement theIterable
-interface.
-