Skip to content

Instantly share code, notes, and snippets.

@DannyDelott
Last active August 29, 2015 14:15
Show Gist options
  • Save DannyDelott/daf4d6cd577c14f06ae5 to your computer and use it in GitHub Desktop.
Save DannyDelott/daf4d6cd577c14f06ae5 to your computer and use it in GitHub Desktop.
Stores collected tweets from the Twitter API
public class TweetBuffer {
private int id;
private String saveDirectory;
private HashSet<Status> tweets;
private boolean isProcessing;
// constructor
public TweetBuffer(int id, String saveDirectory) {
this.id = id;
this.saveDirectory = saveDirectory;
tweets = new HashSet<Status>();
isProcessing = false;
}
// public methods
public void addStatus(Status status) {tweets.add(status);}
public void clearBuffer() {tweets.clear();}
// getters
public int getId() {return id;}
public String getSaveDirectory() {return saveDirectory;}
public HashSet<Status> getTweets() {return tweets;}
public boolean isProcessing() {return isProcessing;}
// setters
public void setProcessing(boolean processing) {
isProcessing = processing;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment