Package bit.connect
Class Student
java.lang.Object
bit.connect.Student
Student is the base class that controls all the information
contained within each user's profile.
A Graphics object encapsulates the state information needed for each user that is utilizing the app whether or not they are active. This state information includes the user's:
- First and last name
- NetID or username
- Preffered Pronouns
- Official Major and Intended Major
- Interests and intended career path
- Current location (only used when user is active)
- Active state
- Filters to match with other users
- Past matches
- Since:
- 1.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondouble
Calculates the distance between the student and another student.double[]
Returns the current location of the student.Returns the filters of the student.getFirst()
Returns the first name of the student.getId()
Returns the ID of the student.Returns the intended major of the student.Returns the interests of the student.getLast()
Returns the last name of the student.Returns the past matches of the student.String[]
Returns the pronouns of the student.Returns the real major of the student.boolean
Returns whether the search mode is on for the student.boolean
matchFilters
(Student student) Checks if the student matches the filters of another student.void
processCreation
(String intendedMajor, List<String> interests) Takes inputs from user instead of from the official database.void
setCurrLoc
(double[] currLoc) Sets the current location of the student.void
setFilters
(Filter filters) Sets the filters of the student.void
Sets the first name of the student.void
Sets the ID of the student.void
setIntendedMajor
(String intendedMajor) Sets the intended major of the student.void
setInterests
(List<String> interests) Sets the interests of the student.void
Sets the last name of the student.void
setPastMatches
(LinkedList<Student> pastMatches) Sets the past matches of the student.void
setPronouns
(String[] pronouns) Sets the pronouns of the student.void
setRealMajor
(String realMajor) Sets the real major of the student.void
setSearchModeOn
(boolean searchModeOn) Sets whether the search mode is on for the student.toString()
Returns a string representation of the student.void
Toggles the search mode of the student.
-
Constructor Details
-
Student
public Student(String lastName, String firstName, String netID, String[] pronouns, String realMajor) Class constructor. All information should be accessed through the UW Student database. The official major is ensured to be a part of the official list of UW majors, found in the official UW database. All other variables other than those inputted are initialized as empty data- types. The student is added to the list of enrolled students in the Cloud class.- Parameters:
lastName
- the last name of the studentfirstName
- the first name of the studentnetID
- the ID of the student, typically taken as the NetIDpronouns
- the pronouns of the student, written as [nominative, accusative, possessive]realMajor
- the official major of the student- Throws:
IllegalArgumentException
- if the official major is not a major at UW, typically will not be called
-
-
Method Details
-
processCreation
Takes inputs from user instead of from the official database. The intent with this is to create relationships between users based on personality and future goals rather than their current standings.- Parameters:
intendedMajor
- the intended major of the student, must be a major at UWinterests
- the interests of the student, taken from a pre-set list- Throws:
IllegalArgumentException
- if the intended major is not a major at UW
-
matchFilters
Checks if the student matches the filters of another student. Both users must match the other's filters exactly. If even one does not match the other, the filters do not match.- Parameters:
student
- the student to compare filters with- Returns:
- true if the student matches the filters, false otherwise
-
turnSearchMode
public void turnSearchMode()Toggles the search mode of the student. When the student is not actively searching for other users, the coordinates are set to (0.0, 0.0) -
distance
Calculates the distance between the student and another student.- Parameters:
student
- the student to calculate the distance to- Returns:
- the distance between the students
-
toString
Returns a string representation of the student. -
getLast
Returns the last name of the student.- Returns:
- the last name of the student
-
getFirst
Returns the first name of the student.- Returns:
- the first name of the student
-
getId
Returns the ID of the student.- Returns:
- the ID of the student
-
getPronouns
Returns the pronouns of the student.- Returns:
- the pronouns of the student
-
getRealMajor
Returns the real major of the student.- Returns:
- the real major of the student
-
getIntendedMajor
Returns the intended major of the student.- Returns:
- the intended major of the student
-
getInterests
Returns the interests of the student.- Returns:
- the interests of the student
-
getCurrLoc
public double[] getCurrLoc()Returns the current location of the student.- Returns:
- the current location of the student
-
isSearchModeOn
public boolean isSearchModeOn()Returns whether the search mode is on for the student.- Returns:
- true if the search mode is on, false otherwise
-
getFilters
Returns the filters of the student.- Returns:
- the filters of the student
-
getPastMatches
Returns the past matches of the student.- Returns:
- the past matches of the student
-
setLast
Sets the last name of the student.- Parameters:
last
- the last name of the student
-
setFirst
Sets the first name of the student.- Parameters:
first
- the first name of the student
-
setId
Sets the ID of the student.- Parameters:
id
- the ID of the student
-
setPronouns
Sets the pronouns of the student.- Parameters:
pronouns
- the pronouns of the student
-
setRealMajor
Sets the real major of the student.- Parameters:
realMajor
- the real major of the student
-
setIntendedMajor
Sets the intended major of the student.- Parameters:
intendedMajor
- the intended major of the student
-
setInterests
Sets the interests of the student.- Parameters:
interests
- the interests of the student
-
setCurrLoc
public void setCurrLoc(double[] currLoc) Sets the current location of the student.- Parameters:
currLoc
- the current location of the student
-
setSearchModeOn
public void setSearchModeOn(boolean searchModeOn) Sets whether the search mode is on for the student.- Parameters:
searchModeOn
- true if the search mode is on, false otherwise
-
setFilters
Sets the filters of the student.- Parameters:
filters
- the filters of the student
-
setPastMatches
Sets the past matches of the student.- Parameters:
pastMatches
- the past matches of the student
-