Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
fip112-2025-g41
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
BINTI TENGKU MASRULHISHAM Tengku Maryam Naqeesha
fip112-2025-g41
Commits
9a8f71f6
Commit
9a8f71f6
authored
1 month ago
by
tmnaqeesha
Browse files
Options
Downloads
Plain Diff
fix: Resolve conflicts
parents
e291f5fc
16d2e3e3
No related branches found
No related tags found
2 merge requests
!5
Merge code for Iteration 2 with main
,
!4
Iteration2
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
.idea/.gitignore
+3
-0
3 additions, 0 deletions
.idea/.gitignore
src/opinion/Member.java
+20
-30
20 additions, 30 deletions
src/opinion/Member.java
src/opinion/SocialNetwork.java
+42
-20
42 additions, 20 deletions
src/opinion/SocialNetwork.java
with
65 additions
and
50 deletions
.idea/.gitignore
+
3
−
0
View file @
9a8f71f6
...
...
@@ -6,3 +6,6 @@
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml
# Bytecode generated after compilation
../out/
This diff is collapsed.
Click to expand it.
src/opinion/Member.java
+
20
−
30
View file @
9a8f71f6
...
...
@@ -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 value
s of a member
* @return
the values
* String function to display
detail
s 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
();
}
}
This diff is collapsed.
Click to expand it.
src/opinion/SocialNetwork.java
+
42
−
20
View file @
9a8f71f6
...
...
@@ -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
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment