Browse Source

removed account constructor

Trinh Tong 6 years ago
parent
commit
c44d35b033
2 changed files with 56 additions and 76 deletions
  1. 54
    69
      .idea/workspace.xml
  2. 2
    7
      Checkbook/src/main/java/Account.java

+ 54
- 69
.idea/workspace.xml View File

@@ -32,7 +32,7 @@
32 32
       </usages-collector>
33 33
       <usages-collector id="statistics.file.types.edit">
34 34
         <counts>
35
-          <entry key="JAVA" value="11867" />
35
+          <entry key="JAVA" value="12042" />
36 36
           <entry key="Markdown" value="11" />
37 37
         </counts>
38 38
       </usages-collector>
@@ -44,8 +44,8 @@
44 44
         <entry file="file://$PROJECT_DIR$/README.md">
45 45
           <provider selected="true" editor-type-id="split-provider[text-editor;markdown-preview-editor]">
46 46
             <state split_layout="FIRST">
47
-              <first_editor relative-caret-position="417">
48
-                <caret line="45" column="14" lean-forward="true" selection-start-line="45" selection-start-column="14" selection-end-line="45" selection-end-column="14" />
47
+              <first_editor relative-caret-position="145">
48
+                <caret line="42" column="49" lean-forward="true" selection-start-line="42" selection-start-column="49" selection-end-line="42" selection-end-column="49" />
49 49
               </first_editor>
50 50
               <second_editor />
51 51
             </state>
@@ -142,35 +142,28 @@
142 142
           </provider>
143 143
         </entry>
144 144
       </file>
145
-      <file pinned="false" current-in-tab="false">
145
+      <file pinned="false" current-in-tab="true">
146 146
         <entry file="file://$PROJECT_DIR$/Checkbook/src/main/java/Account.java">
147 147
           <provider selected="true" editor-type-id="text-editor">
148
-            <state relative-caret-position="940">
149
-              <caret line="50" lean-forward="true" selection-start-line="50" selection-end-line="50" />
148
+            <state relative-caret-position="207">
149
+              <caret line="9" column="5" lean-forward="true" selection-start-line="9" selection-start-column="5" selection-end-line="9" selection-end-column="5" />
150 150
               <folding>
151
-                <element signature="imports" expanded="true" />
152
-                <element signature="e#198#199#0" expanded="true" />
153
-                <element signature="e#236#237#0" expanded="true" />
154 151
                 <element signature="e#380#381#0" expanded="true" />
155 152
                 <element signature="e#408#409#0" expanded="true" />
156 153
                 <element signature="e#449#450#0" expanded="true" />
157 154
                 <element signature="e#483#484#0" expanded="true" />
158 155
                 <element signature="e#517#518#0" expanded="true" />
159 156
                 <element signature="e#547#548#0" expanded="true" />
160
-                <element signature="e#864#865#0" expanded="true" />
161
-                <element signature="e#918#919#0" expanded="true" />
162
-                <element signature="e#965#966#0" expanded="true" />
163
-                <element signature="e#1022#1023#0" expanded="true" />
164 157
               </folding>
165 158
             </state>
166 159
           </provider>
167 160
         </entry>
168 161
       </file>
169
-      <file pinned="false" current-in-tab="true">
162
+      <file pinned="false" current-in-tab="false">
170 163
         <entry file="file://$PROJECT_DIR$/Checkbook/src/test/java/AccountTest.java">
171 164
           <provider selected="true" editor-type-id="text-editor">
172
-            <state relative-caret-position="230">
173
-              <caret line="10" lean-forward="true" selection-start-line="10" selection-end-line="10" />
165
+            <state relative-caret-position="92">
166
+              <caret line="4" column="26" selection-start-line="4" selection-start-column="26" selection-end-line="4" selection-end-column="26" />
174 167
               <folding>
175 168
                 <element signature="imports" expanded="true" />
176 169
               </folding>
@@ -181,8 +174,8 @@
181 174
       <file pinned="false" current-in-tab="false">
182 175
         <entry file="file://$PROJECT_DIR$/Checkbook/src/main/java/AccountBook.java">
183 176
           <provider selected="true" editor-type-id="text-editor">
184
-            <state relative-caret-position="46">
185
-              <caret line="2" column="17" selection-start-line="2" selection-start-column="17" selection-end-line="2" selection-end-column="17" />
177
+            <state relative-caret-position="247">
178
+              <caret line="11" column="25" lean-forward="true" selection-start-line="11" selection-start-column="25" selection-end-line="11" selection-end-column="25" />
186 179
             </state>
187 180
           </provider>
188 181
         </entry>
@@ -237,10 +230,10 @@
237 230
         <option value="$PROJECT_DIR$/README.md" />
238 231
         <option value="$PROJECT_DIR$/Checkbook/src/main/java/Transaction.java" />
239 232
         <option value="$PROJECT_DIR$/Checkbook/src/main/java/Payee.java" />
240
-        <option value="$PROJECT_DIR$/Checkbook/src/main/java/Account.java" />
241 233
         <option value="$PROJECT_DIR$/Checkbook/src/test/java/CheckbookTest.java" />
242 234
         <option value="$PROJECT_DIR$/Checkbook/src/main/java/Checkbook.java" />
243 235
         <option value="$PROJECT_DIR$/Checkbook/src/test/java/AccountTest.java" />
236
+        <option value="$PROJECT_DIR$/Checkbook/src/main/java/Account.java" />
244 237
       </list>
245 238
     </option>
246 239
   </component>
@@ -326,7 +319,7 @@
326 319
   <component name="PropertiesComponent">
327 320
     <property name="WebServerToolWindowFactoryState" value="false" />
328 321
     <property name="aspect.path.notification.shown" value="true" />
329
-    <property name="com.android.tools.idea.instantapp.provision.ProvisionBeforeRunTaskProvider.myTimeStamp" value="1544142505823" />
322
+    <property name="com.android.tools.idea.instantapp.provision.ProvisionBeforeRunTaskProvider.myTimeStamp" value="1544142656991" />
330 323
     <property name="com.intellij.testIntegration.createTest.CreateTestDialog.defaultLibrary" value="JUnit4" />
331 324
     <property name="com.intellij.testIntegration.createTest.CreateTestDialog.defaultLibrarySuperClass.JUnit4" value="" />
332 325
     <property name="extract.method.default.visibility" value="private" />
@@ -475,7 +468,7 @@
475 468
       <option name="presentableId" value="Default" />
476 469
       <updated>1543958631974</updated>
477 470
       <workItem from="1543958633447" duration="3259000" />
478
-      <workItem from="1544046850600" duration="30651000" />
471
+      <workItem from="1544046850600" duration="31245000" />
479 472
     </task>
480 473
     <servers />
481 474
   </component>
@@ -512,13 +505,12 @@
512 505
     </history-entry>
513 506
   </component>
514 507
   <component name="TimeTrackingManager">
515
-    <option name="totallyTimeSpent" value="33910000" />
508
+    <option name="totallyTimeSpent" value="34504000" />
516 509
   </component>
517 510
   <component name="ToolWindowManager">
518 511
     <frame x="0" y="23" width="1440" height="877" extended-state="0" />
519
-    <editor active="true" />
520 512
     <layout>
521
-      <window_info active="true" content_ui="combo" id="Project" order="0" visible="true" weight="0.2532189" />
513
+      <window_info content_ui="combo" id="Project" order="0" visible="true" weight="0.2532189" />
522 514
       <window_info id="Structure" order="1" weight="0.25" />
523 515
       <window_info id="Image Layers" order="2" />
524 516
       <window_info id="Designer" order="3" />
@@ -529,12 +521,12 @@
529 521
       <window_info anchor="bottom" id="Messages" weight="0.32769832" />
530 522
       <window_info anchor="bottom" id="Message" order="0" />
531 523
       <window_info anchor="bottom" id="Find" order="1" />
532
-      <window_info anchor="bottom" id="Run" order="2" sideWeight="0.49928468" visible="true" weight="0.32769832" />
524
+      <window_info anchor="bottom" id="Run" order="2" sideWeight="0.49928468" weight="0.32769832" />
533 525
       <window_info anchor="bottom" id="Debug" order="3" weight="0.39921975" />
534 526
       <window_info anchor="bottom" id="Cvs" order="4" weight="0.25" />
535 527
       <window_info anchor="bottom" id="Inspection" order="5" weight="0.4" />
536 528
       <window_info anchor="bottom" id="TODO" order="6" />
537
-      <window_info anchor="bottom" id="Terminal" order="7" weight="0.32769832" />
529
+      <window_info active="true" anchor="bottom" id="Terminal" order="7" visible="true" weight="0.32769832" />
538 530
       <window_info anchor="bottom" id="Event Log" order="8" sideWeight="0.5007153" side_tool="true" weight="0.32769832" />
539 531
       <window_info anchor="bottom" id="Version Control" order="9" />
540 532
       <window_info anchor="right" id="Commander" order="0" weight="0.4" />
@@ -672,33 +664,38 @@
672 664
         </state>
673 665
       </provider>
674 666
     </entry>
675
-    <entry file="file://$PROJECT_DIR$/README.md">
676
-      <provider selected="true" editor-type-id="split-provider[text-editor;markdown-preview-editor]">
677
-        <state split_layout="FIRST">
678
-          <first_editor relative-caret-position="417">
679
-            <caret line="45" column="14" lean-forward="true" selection-start-line="45" selection-start-column="14" selection-end-line="45" selection-end-column="14" />
680
-          </first_editor>
681
-          <second_editor />
682
-        </state>
683
-      </provider>
684
-    </entry>
685
-    <entry file="file://$PROJECT_DIR$/Checkbook/src/main/java/AccountBook.java">
667
+    <entry file="file://$PROJECT_DIR$/Checkbook/src/main/java/Transaction.java">
686 668
       <provider selected="true" editor-type-id="text-editor">
687
-        <state relative-caret-position="46">
688
-          <caret line="2" column="17" selection-start-line="2" selection-start-column="17" selection-end-line="2" selection-end-column="17" />
669
+        <state relative-caret-position="161">
670
+          <caret line="7" selection-start-line="7" selection-end-line="8" selection-end-column="91" />
671
+          <folding>
672
+            <element signature="imports" expanded="true" />
673
+          </folding>
689 674
         </state>
690 675
       </provider>
691 676
     </entry>
692
-    <entry file="file://$PROJECT_DIR$/Checkbook/src/main/java/Transaction.java">
677
+    <entry file="file://$PROJECT_DIR$/Checkbook/src/test/java/CheckbookTest.java">
693 678
       <provider selected="true" editor-type-id="text-editor">
694
-        <state relative-caret-position="161">
695
-          <caret line="7" selection-start-line="7" selection-end-line="8" selection-end-column="91" />
679
+        <state relative-caret-position="-535">
680
+          <caret line="389" lean-forward="true" selection-start-line="389" selection-end-line="389" />
696 681
           <folding>
697 682
             <element signature="imports" expanded="true" />
683
+            <element signature="e#2268#2269#0" expanded="true" />
684
+            <element signature="e#2316#2317#0" expanded="true" />
698 685
           </folding>
699 686
         </state>
700 687
       </provider>
701 688
     </entry>
689
+    <entry file="file://$PROJECT_DIR$/README.md">
690
+      <provider selected="true" editor-type-id="split-provider[text-editor;markdown-preview-editor]">
691
+        <state split_layout="FIRST">
692
+          <first_editor relative-caret-position="145">
693
+            <caret line="42" column="49" lean-forward="true" selection-start-line="42" selection-start-column="49" selection-end-line="42" selection-end-column="49" />
694
+          </first_editor>
695
+          <second_editor />
696
+        </state>
697
+      </provider>
698
+    </entry>
702 699
     <entry file="file://$PROJECT_DIR$/Checkbook/src/main/java/Checkbook.java">
703 700
       <provider selected="true" editor-type-id="text-editor">
704 701
         <state relative-caret-position="3749">
@@ -761,46 +758,34 @@
761 758
         </state>
762 759
       </provider>
763 760
     </entry>
764
-    <entry file="file://$PROJECT_DIR$/Checkbook/src/main/java/Account.java">
761
+    <entry file="file://$PROJECT_DIR$/Checkbook/src/main/java/AccountBook.java">
765 762
       <provider selected="true" editor-type-id="text-editor">
766
-        <state relative-caret-position="940">
767
-          <caret line="50" lean-forward="true" selection-start-line="50" selection-end-line="50" />
768
-          <folding>
769
-            <element signature="imports" expanded="true" />
770
-            <element signature="e#198#199#0" expanded="true" />
771
-            <element signature="e#236#237#0" expanded="true" />
772
-            <element signature="e#380#381#0" expanded="true" />
773
-            <element signature="e#408#409#0" expanded="true" />
774
-            <element signature="e#449#450#0" expanded="true" />
775
-            <element signature="e#483#484#0" expanded="true" />
776
-            <element signature="e#517#518#0" expanded="true" />
777
-            <element signature="e#547#548#0" expanded="true" />
778
-            <element signature="e#864#865#0" expanded="true" />
779
-            <element signature="e#918#919#0" expanded="true" />
780
-            <element signature="e#965#966#0" expanded="true" />
781
-            <element signature="e#1022#1023#0" expanded="true" />
782
-          </folding>
763
+        <state relative-caret-position="247">
764
+          <caret line="11" column="25" lean-forward="true" selection-start-line="11" selection-start-column="25" selection-end-line="11" selection-end-column="25" />
783 765
         </state>
784 766
       </provider>
785 767
     </entry>
786
-    <entry file="file://$PROJECT_DIR$/Checkbook/src/test/java/CheckbookTest.java">
768
+    <entry file="file://$PROJECT_DIR$/Checkbook/src/test/java/AccountTest.java">
787 769
       <provider selected="true" editor-type-id="text-editor">
788
-        <state relative-caret-position="-535">
789
-          <caret line="389" lean-forward="true" selection-start-line="389" selection-end-line="389" />
770
+        <state relative-caret-position="92">
771
+          <caret line="4" column="26" selection-start-line="4" selection-start-column="26" selection-end-line="4" selection-end-column="26" />
790 772
           <folding>
791 773
             <element signature="imports" expanded="true" />
792
-            <element signature="e#2268#2269#0" expanded="true" />
793
-            <element signature="e#2316#2317#0" expanded="true" />
794 774
           </folding>
795 775
         </state>
796 776
       </provider>
797 777
     </entry>
798
-    <entry file="file://$PROJECT_DIR$/Checkbook/src/test/java/AccountTest.java">
778
+    <entry file="file://$PROJECT_DIR$/Checkbook/src/main/java/Account.java">
799 779
       <provider selected="true" editor-type-id="text-editor">
800
-        <state relative-caret-position="230">
801
-          <caret line="10" lean-forward="true" selection-start-line="10" selection-end-line="10" />
780
+        <state relative-caret-position="207">
781
+          <caret line="9" column="5" lean-forward="true" selection-start-line="9" selection-start-column="5" selection-end-line="9" selection-end-column="5" />
802 782
           <folding>
803
-            <element signature="imports" expanded="true" />
783
+            <element signature="e#380#381#0" expanded="true" />
784
+            <element signature="e#408#409#0" expanded="true" />
785
+            <element signature="e#449#450#0" expanded="true" />
786
+            <element signature="e#483#484#0" expanded="true" />
787
+            <element signature="e#517#518#0" expanded="true" />
788
+            <element signature="e#547#548#0" expanded="true" />
804 789
           </folding>
805 790
         </state>
806 791
       </provider>

+ 2
- 7
Checkbook/src/main/java/Account.java View File

@@ -9,15 +9,10 @@ public class Account<T extends AccountBook> {
9 9
         balance = book.getAmount();
10 10
     }
11 11
 
12
-    public Account(T book, double balance) {
13
-        accountBook = book;
14
-        this.balance = balance;
15
-    }
16
-
17
-    public Account(T book, Payee owner, double balance) {
12
+    public Account(T book, Payee owner) {
18 13
         accountBook = book;
19 14
         this.owner = owner;
20
-        this.balance = balance;
15
+        this.balance = book.getAmount();
21 16
     }
22 17
 
23 18
     public Payee getOwner() {