title: Get data from file - Buffered Reader
body: <p>I would just have the id, the content and the hashtag and time of every tweet in a text file, and I dont know how to store infomration in lists of tweet,
  I created a tweet class as follows:</p>
  
  <pre><code>            public class Tweet {
  private String type;
  private String origin;  
  private String tweetText;
  private String url;
  private String tweetID;
  private String tweetDate;
  private int retCount;
  private String favourit;
  private String mEntities;
  private String hashtags;
  
  public Tweet(String tweetID,String origin) {
      this.tweetID = tweetID;
      this.origin = origin;
  }
  
  public Tweet(String type, String origin, String tweetText, String url, String tweetID, String tweetDate, int retCount, String favourit, String mEntities, String hashtags) {
      this.type = type;
      this.origin = origin;
      this.tweetText = tweetText;
      this.url = url;
      this.tweetID = tweetID;
      this.tweetDate = tweetDate;
      this.retCount = retCount;
      this.favourit = favourit;
      this.mEntities = mEntities;
      this.hashtags = hashtags;
  }
  
  
  
  
  public String getType() {
      return type;
  }
  
  public void setType(String type) {
      this.type = type;
  }
  
  public String getOrigin() {
      return origin;
  }
  
  public void setOrigin(String origin) {
      this.origin = origin;
  }
  
  public String getTweetText() {
      return tweetText;
  }
  
  public void setTweetText(String tweetText) {
      this.tweetText = tweetText;
  }
  
  public String getUrl() {
      return url;
  }
  
  public void setUrl(String url) {
      this.url = url;
  }
  
  public String getTweetID() {
      return tweetID;
  }
  
  public void setTweetID(String tweetID) {
      this.tweetID = tweetID;
  }
  
  public String getTweetDate() {
      return tweetDate;
  }
  
  public void setTweetDate(String tweetDate) {
      this.tweetDate = tweetDate;
  }
  
  public int getRetCount() {
      return retCount;
  }
  
  public void setRetCount(int retCount) {
      this.retCount = retCount;
  }
  
  public String getFavourit() {
      return favourit;
  }
  
  public void setFavourit(String favourit) {
      this.favourit = favourit;
  }
  
  public String getmEntities() {
      return mEntities;
  }
  
  public void setmEntities(String mEntities) {
      this.mEntities = mEntities;
  }
  
  public String getHashtags() {
      return hashtags;
  }
  
  public void setHashtags(String hashtags) {
      this.hashtags = hashtags;
  }
  </code></pre>
  
  <p>and my data file has the following format:</p>
  
  <pre><code>             ***
               ***
               Type:status
               Origin: Here's link to listen live to our discussion of  #debtceiling #politics : 
               Text: Here's link to listen live to our discussion of   : 
               URL: 
               ID: 96944336150867968
               Time: Fri Jul 29 09:05:05 CDT 2011
               RetCount: 0
               Favorite: false
               MentionedEntities: 
               Hashtags:  debtceiling politics
               ***
               ***
               Type:status
               Origin: Now we're talking #debtceiling w/ Dick Polman @NewsWorksWHYY @PhillyInquirer &amp; Bill Galston @BrookingsInst @NoLabelsOrg 
              Text: Now we're talking  w/ Dick Polman   &amp; Bill Galston   
              URL: 
              ID: 96943803600089088
              Time: Fri Jul 29 09:02:58 CDT 2011
              RetCount: 1
              Favorite: false
              MentionedEntities: 136337303 151106990 14495726 15161791 
              Hashtags:  debtceiling
              ***
              ***
  </code></pre>
  
  <p>I want to read this file and stock information into lists, i begin with this code, but i dont know how to solve that</p>
  
  <pre><code>            public static List&lt;String&gt; readTweets(File file) throws IOException {
      List&lt;String&gt; tweets = new ArrayList&lt;String&gt;();
      //logger.info("Read tweets from {}", file.getAbsolutePath());
      BufferedReader reader = new BufferedReader(new FileReader(file));
      String line;
      String[] fields;
      while ((line = reader.readLine()) != null) {
          fields = line.split(",");
          if (fields.length &gt; 1)
              tweets.add(fields[1]);
      }
      return tweets;
  }
  </code></pre>