Skip to content
Snippets Groups Projects
Commit 9a8f71f6 authored by tmnaqeesha's avatar tmnaqeesha
Browse files

fix: Resolve conflicts

parents e291f5fc 16d2e3e3
No related branches found
No related tags found
2 merge requests!5Merge code for Iteration 2 with main,!4Iteration2
......@@ -6,3 +6,6 @@
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml
# Bytecode generated after compilation
../out/
......@@ -4,19 +4,23 @@ package opinion;
/**
* This class allows us to create and register new members
* A member has a login, a password and a profile that he has to register before connecting to the site
* @author Maryam TENGKU
* @author Neva MASSY
* @version 1.0
* @since 1.0
*/
public class Member{
//Declaration of private class variables
/**
* Declaration of member's login, password and profile.
*/
private String login, password, profile;
/**
* Initialization of private class variables by the constructor
* @param login
* @param password
* @param profile
* Construct new Member with specified login, password and profile.
* @param login member's login
* @param password member's password
* @param profile member's profile
*/
Member(String login, String password, String profile) {
this.login = login;
......@@ -25,26 +29,16 @@ public class Member{
}
/**
* Overload of the constructor
* We use it to retrieve the member in a list without needing all the parameters of it
* @param login
* @param password
* @param profile
*/
/**
* String function to retrieve the member's login
* @return the login
* Returns member's login
* @return login
*/
public String getLogin(){
return login;
}
/**
* String function to retrieve the member's password
* @return the password
* Returns member's password
* @return password
*/
public String getPassword(){
return password;
......@@ -52,22 +46,18 @@ public class Member{
/**
* String function to retrieve the member's profile
* @return the profile
* Returns member's profile
* @return profile
*/
public String getProfile(){
return profile;
}
/**
* String function to display the values of a member
* @return the values
* String function to display details of a member (login and profile)
* @return string of details of a member
*/
public String toString() {
return "Login : " + getLogin() + " Profile: " + getProfile() + "\n ";
return "Login : " + getLogin() + "\nProfile: " + getProfile();
}
}
......@@ -11,48 +11,65 @@ import exceptions.NotMemberException;
/**
* Skeleton for the SocialNetwork
*
*
* @author Tengku Maryam BINTI
* @author Neva MASSY
*
* @version 1.0
*/
public class SocialNetwork implements ISocialNetwork {
private LinkedList<Member> listMember;
private Member member;
private int nbmembers;
private int nbmembers, nbbooks;
private LinkedList<Book> listBook;
private Book book;
/**
* Initialization of private class variables by the constructor
* Constructs new SocialNetwork instance with empty member list.
*/
public SocialNetwork() {
listMember = new LinkedList<Member>();
nbmembers=0;
nbbooks=0;
}
/**
* Returns number of registered members.
* @return number of members
*/
@Override
public int nbMembers() {
// TODO Auto-generated method stub
return nbmembers;
}
/**
* Returns number of films.
*/
@Override
public int nbFilms() {
// TODO Auto-generated method stub
return 0;
}
/**
* Returns number of books.
*/
@Override
public int nbBooks() {
// TODO Auto-generated method stub
return 0;
}
/**
* Checks whether a member already exists.
* @param login the login to check
* @return true if login exists, else return false
*/
public boolean memberRegister(String login) {
for(Member m : listMember) {
if(m.getLogin().toUpperCase().trim().equals(login.toUpperCase().trim())) {
......@@ -91,8 +108,14 @@ public class SocialNetwork implements ISocialNetwork {
return result;
}
/**
* Adds a new member to the social network.
* @param login the new member's login
* @param password the new member's password
* @param profile a free String describing the new member's profile
* @throws BadEntryException if parameter is null or too short
* @throws MemberAlreadyExistsException if login already exists
*/
@Override
public void addMember(String login, String password, String profile) throws BadEntryException, MemberAlreadyExistsException{
if (profile==null){
......@@ -107,6 +130,12 @@ public class SocialNetwork implements ISocialNetwork {
nbmembers++;
}
if(validateuser(login, password) ){
member = new Member(login, password, profile);
listMember.add(member);
nbmembers++;
}
......@@ -132,20 +161,13 @@ public class SocialNetwork implements ISocialNetwork {
}
@Override
public void addItemFilm(String login, String password, String title,
String kind, String director, String scriptwriter, int duration)
throws BadEntryException, NotMemberException,
ItemFilmAlreadyExistsException {
// TODO Auto-generated method stub
public void addItemFilm(String login, String password, String title, String kind, String director, String scriptwriter, int duration)
throws BadEntryException, NotMemberException, ItemFilmAlreadyExistsException {
}
@Override
public float reviewItemFilm(String login, String password, String title,
float mark, String comment) throws BadEntryException,
NotMemberException, NotItemException {
float mark, String comment) throws BadEntryException, NotMemberException, NotItemException {
// TODO Auto-generated method stub
return 0;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment