forked from hazelybell/lonelyTwitter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
changes.txt
105 lines (105 loc) · 2.58 KB
/
changes.txt
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
diff --git a/src/ca/ualberta/cs/lonelytwitter/ImportantTweetModel.java b/src/ca/ualberta/cs/lonelytwitter/ImportantTweetModel.java
new file mode 100644
index 0000000..4369013
--- /dev/null
+++ b/src/ca/ualberta/cs/lonelytwitter/ImportantTweetModel.java
@@ -0,0 +1,31 @@
+package ca.ualberta.cs.lonelytwitter;
+
+import java.util.Date;
+
+public class ImportantTweetModel extends AbstractTweetModel {
+
+ public ImportantTweetModel(String text, Date timestamp)
+ {
+ super(text, timestamp);
+ }
+
+ public ImportantTweetModel(String text)
+ {
+ super(text);
+ }
+
+ public String getText(){
+ return "Important! " + super.getText();
+ }
+
+ @Override
+ public Date getTimeStamp() {
+ // TODO Auto-generated method stub
+ return super.timestamp;
+ }
+
+ public boolean isImportant(){
+ return true;
+ }
+
+}
diff --git a/src/ca/ualberta/cs/lonelytwitter/TweetController.java b/src/ca/ualberta/cs/lonelytwitter/TweetController.java
new file mode 100644
index 0000000..08731b6
--- /dev/null
+++ b/src/ca/ualberta/cs/lonelytwitter/TweetController.java
@@ -0,0 +1,20 @@
+package ca.ualberta.cs.lonelytwitter;
+
+import java.util.ArrayList;
+
+
+public class TweetController implements TweetControllerInterface {
+ private TweetListModel tweetListModel;
+
+ public void addTweet(String text) {
+ ArrayList<AbstractTweetModel> list = tweetListModel.getTweetList();
+ list.add(new NormalTweetModel(text));
+ }
+
+ public TweetController() {
+ super();
+ tweetListModel = new TweetListModel();
+ }
+
+
+}
diff --git a/src/ca/ualberta/cs/lonelytwitter/TweetControllerInterface.java b/src/ca/ualberta/cs/lonelytwitter/TweetControllerInterface.java
new file mode 100644
index 0000000..70f3b3d
--- /dev/null
+++ b/src/ca/ualberta/cs/lonelytwitter/TweetControllerInterface.java
@@ -0,0 +1,8 @@
+package ca.ualberta.cs.lonelytwitter;
+
+
+public interface TweetControllerInterface {
+ public void addTweet(String text);
+
+
+}
diff --git a/src/ca/ualberta/cs/lonelytwitter/TweetListModel.java b/src/ca/ualberta/cs/lonelytwitter/TweetListModel.java
new file mode 100644
index 0000000..b548de5
--- /dev/null
+++ b/src/ca/ualberta/cs/lonelytwitter/TweetListModel.java
@@ -0,0 +1,22 @@
+package ca.ualberta.cs.lonelytwitter;
+
+import java.util.ArrayList;
+
+
+public class TweetListModel {
+ private static ArrayList<AbstractTweetModel> tweetList;
+
+ public TweetListModel() {
+ super();
+ tweetList = new ArrayList<AbstractTweetModel>();
+ }
+
+ public ArrayList<AbstractTweetModel> getTweetList() {
+ return tweetList;
+ }
+
+ public void setTweetList(ArrayList<AbstractTweetModel> tweetList) {
+ this.tweetList = tweetList;
+ }
+
+}