summaryrefslogtreecommitdiffstats
path: root/collaboration/GSoC-2011-Eranda/twitapp/src/main/java/twitapp/services/AppManager.java
blob: 0ce20feebaaa1c78005cb6f188b122e204de7773 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package main.java.twitapp.services;

import java.util.ArrayList;
import java.util.Iterator;

public class AppManager {
	
	private User user;
	private UserBase userBase;
	
	public AppManager(String userId){
		userBase = UserBase.getInstance();
		user = userBase.get(userId);
	}
	
	public void twit(String twit){
		user.setTwit(new Twit(twit));
	}
	
	public void follow(String followId){
		user.setFollower(userBase.get(followId));
	}
	
	public Iterator<User> getFollowers(){
		ArrayList<User> users = user.getFollowers();
		return users.iterator();
	}
	
	public Iterator<Twit> getTwits(){
		ArrayList<Twit> twits = user.getTwits();
		return twits.iterator();
	}
	
	public Iterator<Twit> getFollowerTwits(String followeId){
		ArrayList<Twit> followerTwits= userBase.get(followeId).getTwits();
		return followerTwits.iterator();
	}
	
}