title: Issues with external file being stored in an arrayList
body: <p>the problem I have today is that I have to create an arrayList and store info about movies from an external file in it. However, I then have to create a method that ADDS movie  in my arrayList. The problem is that it has to compare if the movie that is being added already exists in my arrayList. However, I just know how to read from the file and store it in my arrayList as a string. Any idea on how I could make it work? </p>
  
  <p>My inventory class does the following ( at the moment): </p>
  
  <pre><code>    private ArrayList&lt;String&gt; movieList;
  
      public Inventory() throws IOException{
  
          BufferedReader br = null;
          this.movieList = new ArrayList&lt;String&gt;();
  
       try {
               br = new BufferedReader(new FileReader("movieBase"));
                String str;
                 while ((str = br.readLine()) != null) {
                    movieList.add(str);
                    System.out.println(str);
                  }
              br.close();
          }catch (FileNotFoundException e){
              e.printStackTrace();
          }catch (IOException e){
              System.out.println(e);
          }
      }
      public void addMovie(String title, int year, int duration, double rating){
  
          movie newMovie = new movie (title, year,duration,rating);
          for(String str : movieList){
  
          }
      }       
  }
  </code></pre>
  
  <p>EDIT** ( I thought it would be a good idea to include this) My external file looks as follow: </p>
  
  <p>Captain America: The Winter Soldier - 2014 - 136 - 3.5</p>
  
  <p>Birdman - 2014 - 119 - 3.7</p>
  
  <p>Batman - 1989 - 126 - 3.2</p>
  
  <p>Indiana Jones and the Kingdom of the Crystal Skull - 2008 - 122 - 2.6</p>
  
  <p>King Kong - 1933 - 100 - 3.8</p>
  
  <p>Duck Soup - 1933 - 68 - 3.5</p>
  
  <p>Casablanca - 1942 - 102 - 3.9</p>
  
  <p>Citizen Kane - 1941 - 119 - 3.7</p>
  
  <p>Chinatown - 1974 - 130 - 3.6</p>
  
  <p>The Godfather - 1972 - 175 - 3.9</p>
  
  <p>Skyfall - 2012 - 143 - 3.2</p>
  
  <p>Forest Gump - 1994 - 142 - 3.8</p>
  
  <p>The Matrix - 1999 - 136 - 3.4</p>
  
  <p>Jaws - 1975 - 124 - 3.3</p>
  
  <p>Lawrence of Arabia - 1962 - 216 - 3.5</p>
  
  <p>An American in Paris - 1951 - 113 - 2.9</p>