NedRedmond пре 6 година
родитељ
комит
479c372b8b
2 измењених фајлова са 119 додато и 83 уклоњено
  1. 66
    83
      Checkbook/.idea/workspace.xml
  2. 53
    0
      Checkbook/src/main/java/Checkbook.java

+ 66
- 83
Checkbook/.idea/workspace.xml Прегледај датотеку

2
 <project version="4">
2
 <project version="4">
3
   <component name="ChangeListManager">
3
   <component name="ChangeListManager">
4
     <list default="true" id="86bea83e-ff28-4c08-8563-407f3ac4c927" name="Default Changelist" comment="">
4
     <list default="true" id="86bea83e-ff28-4c08-8563-407f3ac4c927" name="Default Changelist" comment="">
5
-      <change beforePath="$PROJECT_DIR$/Checkbook.iml" beforeDir="false" />
6
-      <change beforePath="$PROJECT_DIR$/src/main/java/AccountBook.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/AccountBook.java" afterDir="false" />
5
+      <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
7
       <change beforePath="$PROJECT_DIR$/src/main/java/Checkbook.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/Checkbook.java" afterDir="false" />
6
       <change beforePath="$PROJECT_DIR$/src/main/java/Checkbook.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/Checkbook.java" afterDir="false" />
8
-      <change beforePath="$PROJECT_DIR$/src/main/java/Transaction.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/Transaction.java" afterDir="false" />
9
-      <change beforePath="$PROJECT_DIR$/src/test/java/CheckbookTest.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/test/java/CheckbookTest.java" afterDir="false" />
10
     </list>
7
     </list>
11
     <ignored path="$PROJECT_DIR$/target/" />
8
     <ignored path="$PROJECT_DIR$/target/" />
12
     <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
9
     <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
16
     <option name="LAST_RESOLUTION" value="IGNORE" />
13
     <option name="LAST_RESOLUTION" value="IGNORE" />
17
   </component>
14
   </component>
18
   <component name="FileEditorManager">
15
   <component name="FileEditorManager">
19
-    <leaf>
16
+    <leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
20
       <file pinned="false" current-in-tab="false">
17
       <file pinned="false" current-in-tab="false">
21
         <entry file="file://$PROJECT_DIR$/src/main/java/AccountBook.java">
18
         <entry file="file://$PROJECT_DIR$/src/main/java/AccountBook.java">
22
           <provider selected="true" editor-type-id="text-editor">
19
           <provider selected="true" editor-type-id="text-editor">
29
       <file pinned="false" current-in-tab="true">
26
       <file pinned="false" current-in-tab="true">
30
         <entry file="file://$PROJECT_DIR$/src/main/java/Checkbook.java">
27
         <entry file="file://$PROJECT_DIR$/src/main/java/Checkbook.java">
31
           <provider selected="true" editor-type-id="text-editor">
28
           <provider selected="true" editor-type-id="text-editor">
32
-            <state relative-caret-position="1311">
33
-              <caret line="57" column="5" selection-start-line="57" selection-start-column="5" selection-end-line="57" selection-end-column="5" />
29
+            <state relative-caret-position="386">
30
+              <caret line="136" column="57" selection-start-line="136" selection-start-column="57" selection-end-line="136" selection-end-column="57" />
34
               <folding>
31
               <folding>
35
-                <element signature="e#224#225#0" expanded="true" />
36
-                <element signature="e#276#277#0" expanded="true" />
37
-                <element signature="e#478#479#0" expanded="true" />
38
-                <element signature="e#502#503#0" expanded="true" />
39
-                <element signature="e#548#549#0" expanded="true" />
40
-                <element signature="e#576#577#0" expanded="true" />
41
-                <element signature="e#723#724#0" expanded="true" />
42
-                <element signature="e#751#752#0" expanded="true" />
43
-                <element signature="e#821#822#0" expanded="true" />
44
-                <element signature="e#866#867#0" expanded="true" />
45
-                <element signature="e#799#800#0" expanded="true" />
46
-                <element signature="e#840#841#0" expanded="true" />
47
-                <element signature="e#1045#1046#0" expanded="true" />
48
-                <element signature="e#1069#1070#0" expanded="true" />
32
+                <element signature="imports" expanded="true" />
33
+                <element signature="e#1440#1441#0" expanded="true" />
49
                 <element signature="e#1485#1486#0" expanded="true" />
34
                 <element signature="e#1485#1486#0" expanded="true" />
35
+                <element signature="e#1550#1551#0" expanded="true" />
50
                 <element signature="e#1600#1601#0" expanded="true" />
36
                 <element signature="e#1600#1601#0" expanded="true" />
37
+                <element signature="e#1935#1936#0" expanded="true" />
51
                 <element signature="e#1983#1984#0" expanded="true" />
38
                 <element signature="e#1983#1984#0" expanded="true" />
39
+                <element signature="e#2046#2047#0" expanded="true" />
52
                 <element signature="e#2094#2095#0" expanded="true" />
40
                 <element signature="e#2094#2095#0" expanded="true" />
41
+                <element signature="e#2135#2136#0" expanded="true" />
53
                 <element signature="e#2171#2172#0" expanded="true" />
42
                 <element signature="e#2171#2172#0" expanded="true" />
54
               </folding>
43
               </folding>
55
             </state>
44
             </state>
59
       <file pinned="false" current-in-tab="false">
48
       <file pinned="false" current-in-tab="false">
60
         <entry file="jar:///Library/Java/JavaVirtualMachines/jdk1.8.0_191.jdk/Contents/Home/src.zip!/java/util/ArrayList.java">
49
         <entry file="jar:///Library/Java/JavaVirtualMachines/jdk1.8.0_191.jdk/Contents/Home/src.zip!/java/util/ArrayList.java">
61
           <provider selected="true" editor-type-id="text-editor">
50
           <provider selected="true" editor-type-id="text-editor">
62
-            <state relative-caret-position="-945">
51
+            <state relative-caret-position="15203">
63
               <caret line="701" column="59" selection-start-line="701" selection-start-column="53" selection-end-line="701" selection-end-column="59" />
52
               <caret line="701" column="59" selection-start-line="701" selection-start-column="53" selection-end-line="701" selection-end-column="59" />
64
             </state>
53
             </state>
65
           </provider>
54
           </provider>
69
         <entry file="file://$PROJECT_DIR$/src/main/java/GenericAccount.java">
58
         <entry file="file://$PROJECT_DIR$/src/main/java/GenericAccount.java">
70
           <provider selected="true" editor-type-id="text-editor">
59
           <provider selected="true" editor-type-id="text-editor">
71
             <state relative-caret-position="23">
60
             <state relative-caret-position="23">
72
-              <caret line="1" column="13" selection-start-line="1" selection-start-column="13" selection-end-line="1" selection-end-column="13" />
61
+              <caret line="1" column="52" selection-start-line="1" selection-start-column="52" selection-end-line="1" selection-end-column="52" />
73
             </state>
62
             </state>
74
           </provider>
63
           </provider>
75
         </entry>
64
         </entry>
77
       <file pinned="false" current-in-tab="false">
66
       <file pinned="false" current-in-tab="false">
78
         <entry file="jar:///Library/Java/JavaVirtualMachines/jdk1.8.0_191.jdk/Contents/Home/src.zip!/java/util/Collection.java">
67
         <entry file="jar:///Library/Java/JavaVirtualMachines/jdk1.8.0_191.jdk/Contents/Home/src.zip!/java/util/Collection.java">
79
           <provider selected="true" editor-type-id="text-editor">
68
           <provider selected="true" editor-type-id="text-editor">
80
-            <state relative-caret-position="187">
69
+            <state relative-caret-position="2714">
81
               <caret line="143" column="17" selection-start-line="143" selection-start-column="17" selection-end-line="143" selection-end-column="17" />
70
               <caret line="143" column="17" selection-start-line="143" selection-start-column="17" selection-end-line="143" selection-end-column="17" />
82
             </state>
71
             </state>
83
           </provider>
72
           </provider>
109
         <option value="$PROJECT_DIR$/src/main/java/Transaction.java" />
98
         <option value="$PROJECT_DIR$/src/main/java/Transaction.java" />
110
         <option value="$PROJECT_DIR$/src/main/java/AccountBook.java" />
99
         <option value="$PROJECT_DIR$/src/main/java/AccountBook.java" />
111
         <option value="$PROJECT_DIR$/src/test/java/CheckbookTest.java" />
100
         <option value="$PROJECT_DIR$/src/test/java/CheckbookTest.java" />
101
+        <option value="$PROJECT_DIR$/src/main/java/GenericAccount.java" />
112
         <option value="$PROJECT_DIR$/src/main/java/Checkbook.java" />
102
         <option value="$PROJECT_DIR$/src/main/java/Checkbook.java" />
113
       </list>
103
       </list>
114
     </option>
104
     </option>
115
   </component>
105
   </component>
116
-  <component name="ProjectFrameBounds" extendedState="6" fullScreen="true">
117
-    <option name="width" value="1440" />
106
+  <component name="ProjectFrameBounds" fullScreen="true">
107
+    <option name="width" value="584" />
118
     <option name="height" value="900" />
108
     <option name="height" value="900" />
119
   </component>
109
   </component>
120
   <component name="ProjectLevelVcsManager" settingsEditedManually="true" />
110
   <component name="ProjectLevelVcsManager" settingsEditedManually="true" />
123
       <foldersAlwaysOnTop value="true" />
113
       <foldersAlwaysOnTop value="true" />
124
     </navigator>
114
     </navigator>
125
     <panes>
115
     <panes>
126
-      <pane id="PackagesPane" />
127
       <pane id="Scope" />
116
       <pane id="Scope" />
128
       <pane id="ProjectPane">
117
       <pane id="ProjectPane">
129
         <subPane>
118
         <subPane>
167
           <select />
156
           <select />
168
         </subPane>
157
         </subPane>
169
       </pane>
158
       </pane>
159
+      <pane id="PackagesPane" />
170
     </panes>
160
     </panes>
171
   </component>
161
   </component>
172
   <component name="PropertiesComponent">
162
   <component name="PropertiesComponent">
173
     <property name="WebServerToolWindowFactoryState" value="false" />
163
     <property name="WebServerToolWindowFactoryState" value="false" />
174
     <property name="aspect.path.notification.shown" value="true" />
164
     <property name="aspect.path.notification.shown" value="true" />
175
-    <property name="com.android.tools.idea.instantapp.provision.ProvisionBeforeRunTaskProvider.myTimeStamp" value="1544213381725" />
165
+    <property name="com.android.tools.idea.instantapp.provision.ProvisionBeforeRunTaskProvider.myTimeStamp" value="1544229309062" />
176
     <property name="com.intellij.testIntegration.createTest.CreateTestDialog.defaultLibrary" value="JUnit4" />
166
     <property name="com.intellij.testIntegration.createTest.CreateTestDialog.defaultLibrary" value="JUnit4" />
177
     <property name="com.intellij.testIntegration.createTest.CreateTestDialog.defaultLibrarySuperClass.JUnit4" value="" />
167
     <property name="com.intellij.testIntegration.createTest.CreateTestDialog.defaultLibrarySuperClass.JUnit4" value="" />
178
     <property name="extract.method.default.visibility" value="private" />
168
     <property name="extract.method.default.visibility" value="private" />
209
       <option name="number" value="Default" />
199
       <option name="number" value="Default" />
210
       <option name="presentableId" value="Default" />
200
       <option name="presentableId" value="Default" />
211
       <updated>1544199126934</updated>
201
       <updated>1544199126934</updated>
212
-      <workItem from="1544199128297" duration="10136000" />
202
+      <workItem from="1544199128297" duration="10411000" />
203
+      <workItem from="1544228672333" duration="635000" />
213
     </task>
204
     </task>
214
     <servers />
205
     <servers />
215
   </component>
206
   </component>
216
   <component name="TimeTrackingManager">
207
   <component name="TimeTrackingManager">
217
-    <option name="totallyTimeSpent" value="10136000" />
208
+    <option name="totallyTimeSpent" value="11046000" />
218
   </component>
209
   </component>
219
   <component name="ToolWindowManager">
210
   <component name="ToolWindowManager">
220
-    <frame x="0" y="0" width="904" height="900" extended-state="6" />
211
+    <frame x="0" y="0" width="1440" height="900" extended-state="6" />
221
     <editor active="true" />
212
     <editor active="true" />
222
     <layout>
213
     <layout>
223
-      <window_info id="Favorites" side_tool="true" />
224
-      <window_info id="Image Layers" />
225
-      <window_info id="Designer" />
226
-      <window_info id="UI Designer" />
227
-      <window_info id="Capture Tool" />
228
-      <window_info id="Learn" />
229
-      <window_info active="true" content_ui="combo" id="Project" order="0" visible="true" weight="0.26218098" />
214
+      <window_info active="true" content_ui="combo" id="Project" order="0" visible="true" weight="0.42274678" />
230
       <window_info id="Structure" order="1" side_tool="true" weight="0.25" />
215
       <window_info id="Structure" order="1" side_tool="true" weight="0.25" />
231
-      <window_info anchor="bottom" id="Docker" show_stripe_button="false" />
232
-      <window_info anchor="bottom" id="Version Control" />
233
-      <window_info anchor="bottom" id="Terminal" />
234
-      <window_info anchor="bottom" id="Event Log" side_tool="true" />
235
-      <window_info anchor="bottom" id="Database Changes" />
216
+      <window_info id="Designer" order="2" />
217
+      <window_info id="Image Layers" order="3" />
218
+      <window_info id="Capture Tool" order="4" />
219
+      <window_info id="UI Designer" order="5" />
220
+      <window_info id="Learn" order="6" />
221
+      <window_info id="Favorites" order="7" side_tool="true" />
236
       <window_info anchor="bottom" id="Message" order="0" />
222
       <window_info anchor="bottom" id="Message" order="0" />
237
       <window_info anchor="bottom" id="Find" order="1" />
223
       <window_info anchor="bottom" id="Find" order="1" />
238
       <window_info anchor="bottom" id="Run" order="2" />
224
       <window_info anchor="bottom" id="Run" order="2" />
240
       <window_info anchor="bottom" id="Cvs" order="4" weight="0.25" />
226
       <window_info anchor="bottom" id="Cvs" order="4" weight="0.25" />
241
       <window_info anchor="bottom" id="Inspection" order="5" weight="0.4" />
227
       <window_info anchor="bottom" id="Inspection" order="5" weight="0.4" />
242
       <window_info anchor="bottom" id="TODO" order="6" />
228
       <window_info anchor="bottom" id="TODO" order="6" />
243
-      <window_info anchor="right" id="Palette" />
244
-      <window_info anchor="right" id="Theme Preview" />
245
-      <window_info anchor="right" id="Maven" />
246
-      <window_info anchor="right" id="Capture Analysis" />
247
-      <window_info anchor="right" id="Palette&#9;" />
248
-      <window_info anchor="right" id="Database" />
229
+      <window_info anchor="bottom" id="Docker" order="7" show_stripe_button="false" />
230
+      <window_info anchor="bottom" id="Version Control" order="8" />
231
+      <window_info anchor="bottom" id="Database Changes" order="9" />
232
+      <window_info anchor="bottom" id="Terminal" order="10" />
233
+      <window_info anchor="bottom" id="Event Log" order="11" side_tool="true" />
249
       <window_info anchor="right" id="Commander" internal_type="SLIDING" order="0" type="SLIDING" weight="0.4" />
234
       <window_info anchor="right" id="Commander" internal_type="SLIDING" order="0" type="SLIDING" weight="0.4" />
250
       <window_info anchor="right" id="Ant Build" order="1" weight="0.25" />
235
       <window_info anchor="right" id="Ant Build" order="1" weight="0.25" />
251
       <window_info anchor="right" content_ui="combo" id="Hierarchy" order="2" weight="0.25" />
236
       <window_info anchor="right" content_ui="combo" id="Hierarchy" order="2" weight="0.25" />
237
+      <window_info anchor="right" id="Palette" order="3" />
238
+      <window_info anchor="right" id="Theme Preview" order="4" />
239
+      <window_info anchor="right" id="Maven" order="5" />
240
+      <window_info anchor="right" id="Capture Analysis" order="6" />
241
+      <window_info anchor="right" id="Palette&#9;" order="7" />
242
+      <window_info anchor="right" id="Database" order="8" />
252
     </layout>
243
     </layout>
253
   </component>
244
   </component>
254
   <component name="TypeScriptGeneratedFilesManager">
245
   <component name="TypeScriptGeneratedFilesManager">
255
     <option name="version" value="1" />
246
     <option name="version" value="1" />
256
   </component>
247
   </component>
257
   <component name="editorHistoryManager">
248
   <component name="editorHistoryManager">
258
-    <entry file="jar:///Library/Java/JavaVirtualMachines/jdk1.8.0_191.jdk/Contents/Home/src.zip!/java/util/Collection.java">
259
-      <provider selected="true" editor-type-id="text-editor">
260
-        <state relative-caret-position="187">
261
-          <caret line="143" column="17" selection-start-line="143" selection-start-column="17" selection-end-line="143" selection-end-column="17" />
262
-        </state>
263
-      </provider>
264
-    </entry>
265
-    <entry file="file://$PROJECT_DIR$/src/main/java/AccountBook.java">
266
-      <provider selected="true" editor-type-id="text-editor">
267
-        <state relative-caret-position="46">
268
-          <caret line="2" column="10" selection-start-line="2" selection-start-column="10" selection-end-line="2" selection-end-column="10" />
269
-        </state>
270
-      </provider>
271
-    </entry>
272
     <entry file="file://$PROJECT_DIR$/src/main/java/Transaction.java">
249
     <entry file="file://$PROJECT_DIR$/src/main/java/Transaction.java">
273
       <provider selected="true" editor-type-id="text-editor">
250
       <provider selected="true" editor-type-id="text-editor">
274
         <state relative-caret-position="299">
251
         <state relative-caret-position="299">
297
         </state>
274
         </state>
298
       </provider>
275
       </provider>
299
     </entry>
276
     </entry>
300
-    <entry file="file://$PROJECT_DIR$/src/main/java/GenericAccount.java">
277
+    <entry file="file://$PROJECT_DIR$/src/main/java/AccountBook.java">
301
       <provider selected="true" editor-type-id="text-editor">
278
       <provider selected="true" editor-type-id="text-editor">
302
-        <state relative-caret-position="23">
303
-          <caret line="1" column="13" selection-start-line="1" selection-start-column="13" selection-end-line="1" selection-end-column="13" />
279
+        <state relative-caret-position="46">
280
+          <caret line="2" column="10" selection-start-line="2" selection-start-column="10" selection-end-line="2" selection-end-column="10" />
304
         </state>
281
         </state>
305
       </provider>
282
       </provider>
306
     </entry>
283
     </entry>
307
     <entry file="jar:///Library/Java/JavaVirtualMachines/jdk1.8.0_191.jdk/Contents/Home/src.zip!/java/util/ArrayList.java">
284
     <entry file="jar:///Library/Java/JavaVirtualMachines/jdk1.8.0_191.jdk/Contents/Home/src.zip!/java/util/ArrayList.java">
308
       <provider selected="true" editor-type-id="text-editor">
285
       <provider selected="true" editor-type-id="text-editor">
309
-        <state relative-caret-position="-945">
286
+        <state relative-caret-position="15203">
310
           <caret line="701" column="59" selection-start-line="701" selection-start-column="53" selection-end-line="701" selection-end-column="59" />
287
           <caret line="701" column="59" selection-start-line="701" selection-start-column="53" selection-end-line="701" selection-end-column="59" />
311
         </state>
288
         </state>
312
       </provider>
289
       </provider>
313
     </entry>
290
     </entry>
291
+    <entry file="jar:///Library/Java/JavaVirtualMachines/jdk1.8.0_191.jdk/Contents/Home/src.zip!/java/util/Collection.java">
292
+      <provider selected="true" editor-type-id="text-editor">
293
+        <state relative-caret-position="2714">
294
+          <caret line="143" column="17" selection-start-line="143" selection-start-column="17" selection-end-line="143" selection-end-column="17" />
295
+        </state>
296
+      </provider>
297
+    </entry>
298
+    <entry file="file://$PROJECT_DIR$/src/main/java/GenericAccount.java">
299
+      <provider selected="true" editor-type-id="text-editor">
300
+        <state relative-caret-position="23">
301
+          <caret line="1" column="52" selection-start-line="1" selection-start-column="52" selection-end-line="1" selection-end-column="52" />
302
+        </state>
303
+      </provider>
304
+    </entry>
314
     <entry file="file://$PROJECT_DIR$/src/main/java/Checkbook.java">
305
     <entry file="file://$PROJECT_DIR$/src/main/java/Checkbook.java">
315
       <provider selected="true" editor-type-id="text-editor">
306
       <provider selected="true" editor-type-id="text-editor">
316
-        <state relative-caret-position="1311">
317
-          <caret line="57" column="5" selection-start-line="57" selection-start-column="5" selection-end-line="57" selection-end-column="5" />
307
+        <state relative-caret-position="386">
308
+          <caret line="136" column="57" selection-start-line="136" selection-start-column="57" selection-end-line="136" selection-end-column="57" />
318
           <folding>
309
           <folding>
319
-            <element signature="e#224#225#0" expanded="true" />
320
-            <element signature="e#276#277#0" expanded="true" />
321
-            <element signature="e#478#479#0" expanded="true" />
322
-            <element signature="e#502#503#0" expanded="true" />
323
-            <element signature="e#548#549#0" expanded="true" />
324
-            <element signature="e#576#577#0" expanded="true" />
325
-            <element signature="e#723#724#0" expanded="true" />
326
-            <element signature="e#751#752#0" expanded="true" />
327
-            <element signature="e#821#822#0" expanded="true" />
328
-            <element signature="e#866#867#0" expanded="true" />
329
-            <element signature="e#799#800#0" expanded="true" />
330
-            <element signature="e#840#841#0" expanded="true" />
331
-            <element signature="e#1045#1046#0" expanded="true" />
332
-            <element signature="e#1069#1070#0" expanded="true" />
310
+            <element signature="imports" expanded="true" />
311
+            <element signature="e#1440#1441#0" expanded="true" />
333
             <element signature="e#1485#1486#0" expanded="true" />
312
             <element signature="e#1485#1486#0" expanded="true" />
313
+            <element signature="e#1550#1551#0" expanded="true" />
334
             <element signature="e#1600#1601#0" expanded="true" />
314
             <element signature="e#1600#1601#0" expanded="true" />
315
+            <element signature="e#1935#1936#0" expanded="true" />
335
             <element signature="e#1983#1984#0" expanded="true" />
316
             <element signature="e#1983#1984#0" expanded="true" />
317
+            <element signature="e#2046#2047#0" expanded="true" />
336
             <element signature="e#2094#2095#0" expanded="true" />
318
             <element signature="e#2094#2095#0" expanded="true" />
319
+            <element signature="e#2135#2136#0" expanded="true" />
337
             <element signature="e#2171#2172#0" expanded="true" />
320
             <element signature="e#2171#2172#0" expanded="true" />
338
           </folding>
321
           </folding>
339
         </state>
322
         </state>

+ 53
- 0
Checkbook/src/main/java/Checkbook.java Прегледај датотеку

1
+import java.time.LocalDate;
1
 import java.util.*;
2
 import java.util.*;
2
 
3
 
3
 public class Checkbook<T extends Transaction> implements Collection<T> {
4
 public class Checkbook<T extends Transaction> implements Collection<T> {
88
         transactions.clear();
89
         transactions.clear();
89
     }
90
     }
90
 
91
 
92
+    public double checkbookValue(){
93
+        double sum = 0.0;
94
+        for (Transaction t : transactions) {
95
+            if (t.getType().equals(TransactionType.CREDIT)) {
96
+                sum += t.getAmount();
97
+            } else {
98
+                sum -= t.getAmount();
99
+            }
100
+        }
101
+        return sum;
102
+    }
103
+
104
+    public Transaction[] getTransactionsForDate(LocalDate aDate) {
105
+        ArrayList<Transaction> dateList = new ArrayList<>();
106
+        for (Transaction t : transactions) {
107
+            if (t.getDate().equals(aDate)) {
108
+                dateList.add(t);
109
+            }
110
+        }
111
+        return dateList.toArray(new Transaction[0]);
112
+    }
113
+
114
+    Transaction[] getAllTransactionsForPayee(Payee payee) {
115
+        ArrayList<Transaction> payeeList = new ArrayList<>();
116
+        for (Transaction t : transactions) {
117
+            if (t.getPayee().equals(payee)) {
118
+                payeeList.add(t);
119
+            }
120
+        }
121
+        return payeeList.toArray(new Transaction[0]);
122
+    }
123
+
124
+    Transaction[] getAllDebitTransactions() {
125
+        ArrayList<Transaction> debitList = new ArrayList<>();
126
+        for (Transaction t : transactions) {
127
+            if (t.getType().equals(TransactionType.DEBIT)) {
128
+                debitList.add(t);
129
+            }
130
+        }
131
+        return debitList.toArray(new Transaction[0]);
132
+    }
133
+
134
+    Transaction[] getAllCreditTransactions() {
135
+        ArrayList<Transaction> creditList = new ArrayList<>();
136
+        for (Transaction t : transactions) {
137
+            if (t.getType().equals(TransactionType.CREDIT)) {
138
+                creditList.add(t);
139
+            }
140
+        }
141
+        return creditList.toArray(new Transaction[0]);
142
+    }
143
+
91
     //blind us with your Java eloquence....
144
     //blind us with your Java eloquence....
92
 
145
 
93
 }
146
 }