Class User
java.lang.Object
User
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionUser(String name, double dist, Achievement ach, Calendar cal)
Constructor of the User object; creates a new user object, and adds it to the list of all users -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds a user to this user's friends listvoid
addNewJournalEntry(LocalDateTime days, String s)
Adds a new journal entryvoid
Adds a run to all of user's runsvoid
Prints statistics of user's friends in the console; specifically printing the total distance ran and achievement progressionGets achievement progress of the userGets the user's calendarGets a hashmap of all notes in coordinance with all dates in the journalGets list of all friendsGets number of runsdouble
Gets total distance ranGets the name of the userdouble
calculate the total user specific distancevoid
setAchievement(Achievement ach)
Sets achievement progress of this uservoid
setMyTotalDistance(double myTotalDistance)
Sets total distance ranvoid
setMyUserName(String myUserName)
Sets this user's name
-
Field Details
-
allUsers
-
myRuns
-
-
Constructor Details
-
User
Constructor of the User object; creates a new user object, and adds it to the list of all users- Parameters:
name
- name of the userdist
- distance ran by the userach
- achievement progress? by the usercal
- Calendar for the specific user
-
-
Method Details
-
displayFriendStats
Prints statistics of user's friends in the console; specifically printing the total distance ran and achievement progression- Parameters:
u
- User to see the statistics of
-
addFriend
Adds a user to this user's friends list- Parameters:
u
- User object to be added to the myFriends list
-
myTotalDistance
public double myTotalDistance()calculate the total user specific distance- Returns:
- the total distance ran over all runs
-
addRun
Adds a run to all of user's runs- Parameters:
r
- The run to be added to the user's collection of runs
-
addNewJournalEntry
Adds a new journal entry- Parameters:
days
- days to be added to journal entrys
- Notes/feedback for the specific day(s)
-
getMyRuns
Gets number of runs- Returns:
- number of total runs
-
getMyUserName
Gets the name of the user- Returns:
- user name
-
setMyUserName
Sets this user's name- Parameters:
myUserName
- new username to be changed to
-
getMyTotalDistance
public double getMyTotalDistance()Gets total distance ran- Returns:
- total distance across all runs
-
setMyTotalDistance
public void setMyTotalDistance(double myTotalDistance)Sets total distance ran- Parameters:
myTotalDistance
- total distance ran by this user becomes this var
-
getMyFriends
Gets list of all friends- Returns:
- arraylist of all user's friends
-
getJournal
Gets a hashmap of all notes in coordinance with all dates in the journal- Returns:
- the journal entries
-
getCalendar
Gets the user's calendar- Returns:
- the calendar of the user
-
getAchievement
Gets achievement progress of the user- Returns:
- Progression of achievements by this user
-
setAchievement
Sets achievement progress of this user- Parameters:
ach
- achievement progress to be set to
-