Movie - /* Movie represents a movie. It includes title of...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
/** Movie represents a movie. It includes title of the move, director(s), casts, year made */ public class Movie { private String title; private String[] directors; private String[] casts; private int year; public Movie(String title, String[] directors, String[] casts, int year) { this.title = title; this.directors = new String[directors.length]; for(int i = 0; i < directors.length; i++) { this.directors[i] = directors[i]; } this.casts = new String[casts.length]; for(int i = 0; i < casts.length; i++) { this.casts[i] = casts[i]; } this.year = year; } public boolean searchTitle(String keyword) { String tempTitle = title.toLowerCase(); String tempWord = keyword.toLowerCase(); return tempTitle.indexOf(tempWord) != -1; } public boolean searchDirectors(String keyword) { String tempDir; String tempWord = keyword.toLowerCase(); for(int i = 0; i < directors.length; i++) { tempDir = directors[i].toLowerCase(); if(tempDir.indexOf(tempWord) != -1) { return true; } } return false; } public boolean searchCasts(String keyword) {
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 12/17/2010 for the course JAVA 021210 taught by Professor Michael during the Spring '10 term at NYU.

Page1 / 2

Movie - /* Movie represents a movie. It includes title of...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online