package com.tmitim.twittercli;

import java.util.List;

import twitter4j.Status;
import twitter4j.DirectMessage;
import twitter4j.Location;

public class Printer {

	public void printStatuses(List<Status> statuses) {
		for (Status status : statuses) {
			printStatus(status);
		}

		if (statuses.isEmpty()) {
			System.out.println("No tweets found");
		}
	}

	public void printStatus(Status status) {
		System.out.println(status.getUser().getName() + " (@" + status.getUser().getScreenName() + "): ");
		System.out.println(status.getText());
		System.out.println(status.getCreatedAt());
		System.out.println(String.format("ID: %d RT: %d <3: %d", status.getId(), status.getRetweetCount(),
				status.getFavoriteCount()));
		System.out.println("");
	}

	public void printAvailableLocations(List<Location> locations) {
		for (twitter4j.Location l : locations) {
			printLocation(l);
		}
	}

	public void printLocation(Location location) {
		System.out.println(location.getName() + ": " + location.getWoeid());
	}

	public void printDirectMessages(List<DirectMessage> messages, String username) {
		for (DirectMessage dm : messages) {
			printDirectMessage(dm, username);
		}
	}

	public void printDirectMessage(DirectMessage dm, String username) {
		if (username.equals(dm.getSenderScreenName())) {
			System.out.println(">> " + dm.getRecipientScreenName() + ": " + dm.getText());
		} else {
			System.out.println("<< " + dm.getSenderScreenName() + ": " + dm.getText());
		}
	}
}

@@ -145,13 +145,17 @@
 lic 
-class
+interface
  Pri
@@ -161,25 +161,17 @@
 inter %7B%0A
-%0A%09public 
+%09
 void pri
@@ -207,1267 +207,274 @@
 ses)
- %7B%0A%09%09for (Status status : statuses) %7B%0A%09%09%09printStatus(status);%0A%09%09%7D%0A%0A%09%09if (statuses.isEmpty()) %7B%0A%09%09%09System.out.println(%22No tweets found%22);%0A%09%09%7D%0A%09%7D%0A%0A%09public void printStatus(Status status) %7B%0A%09%09System.out.println(status.getUser().getName() + %22 (@%22 + status.getUser().getScreenName() + %22): %22);%0A%09%09System.out.println(status.getText());%0A%09%09System.out.println(status.getCreatedAt());%0A%09%09System.out.println(String.format(%22ID: %25d RT: %25d %3C3: %25d%22, status.getId(), status.getRetweetCount(),%0A%09%09%09%09status.getFavoriteCount()));%0A%09%09System.out.println(%22%22);%0A%09%7D%0A%0A%09public void printAvailableLocations(List%3CLocation%3E locations) %7B%0A%09%09for (twitter4j.Location l : locations) %7B%0A%09%09%09printLocation(l);%0A%09%09%7D%0A%09%7D%0A%0A%09public void printLocation(Location location) %7B%0A%09%09System.out.println(location.getName() + %22: %22 + location.getWoeid());%0A%09%7D%0A%0A%09public void printDirectMessages(List%3CDirectMessage%3E messages, String username) %7B%0A%09%09for (DirectMessage dm : messages) %7B%0A%09%09%09printDirectMessage(dm, username);%0A%09%09%7D%0A%09%7D%0A%0A%09public void printDirectMessage(DirectMessage dm, String username) %7B%0A%09%09if (username.equals(dm.getSenderScreenName())) %7B%0A%09%09%09System.out.println(%22%3E%3E %22 + dm.getRecipientScreenName() + %22: %22 + dm.getText());%0A%09%09%7D else %7B%0A%09%09%09System.out.println(%22%3C%3C %22 + dm.getSenderScreenName() + %22: %22 + dm.getText());%0A%09%09%7D%0A%09%7D
+;%0A%09void printStatus(Status status);%0A%09void printAvailableLocations(List%3CLocation%3E locations);%0A%09void printLocation(Location location);%0A%09void printDirectMessages(List%3CDirectMessage%3E messages, String username);%0A%09void printDirectMessage(DirectMessage dm, String username);
 %0A%7D%0A

Switch Printer to interface