-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathUserPage.java
52 lines (48 loc) · 1.82 KB
/
UserPage.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
package com.accenture.itfactory.base.FilmApplication;
import java.util.Date;
import java.util.List;
public class UserPage {
FilmDatabase filmDatabase;
public Film searchFilm(String fName, String fId, String fType, String fGenre, Date fDate,
double fRating, String fDescription){
if(fName != null)
return filmDatabase.searchByName(fName);
if(fId != null)
return filmDatabase.searchById(fId);
if(fType != null)
return filmDatabase.searchByType(fType);
if(fGenre!= null)
return filmDatabase.searchByGenre(fGenre);
if(fDate != null)
return filmDatabase.searchByReleaseDate(fDate);
if(fRating != 0)
return filmDatabase.searchByRating(fRating);
if(fDescription != null)
return filmDatabase.searchByDescription(fDescription);
else
return null;
}
public Film search(String stringParam){
return filmDatabase.search(stringParam);
}
public List<Film> viewFilms(){
return filmDatabase.viewFilms();
}
public List<Film> viewFilms(int count){
return filmDatabase.viewFilms(count);
}
public List<Film> viewFilms(int lowerBound,int higherBound){
return filmDatabase.viewFilms(lowerBound,higherBound);
}
public Review searchFilmReview(String fName){
Film f = filmDatabase.searchByName(fName);
return filmDatabase.searchForReview(f.imdbId);
}
public List<Film> searchDateRange(Date lowerDate,Date higherDate){
return filmDatabase.searchDateRange(lowerDate,higherDate);
}
public void AddReview(String fName,String review,String reviewer){
//add review
filmDatabase.addReview(fName,review,reviewer);
}
}