BlackJack 6 years ago
parent
commit
0b5d786c38
8 changed files with 346 additions and 11 deletions
  1. 9
    0
      .idea/ZCW-PhoneBook.iml
  2. 6
    0
      .idea/misc.xml
  3. 8
    0
      .idea/modules.xml
  4. 6
    0
      .idea/vcs.xml
  5. 243
    0
      .idea/workspace.xml
  6. 32
    1
      PhoneBook.java
  7. 17
    2
      PhoneBookTest.java
  8. 25
    8
      package.bluej

+ 9
- 0
.idea/ZCW-PhoneBook.iml View File

@@ -0,0 +1,9 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<module type="JAVA_MODULE" version="4">
3
+  <component name="NewModuleRootManager" inherit-compiler-output="true">
4
+    <exclude-output />
5
+    <content url="file://$MODULE_DIR$" />
6
+    <orderEntry type="inheritedJdk" />
7
+    <orderEntry type="sourceFolder" forTests="false" />
8
+  </component>
9
+</module>

+ 6
- 0
.idea/misc.xml View File

@@ -0,0 +1,6 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<project version="4">
3
+  <component name="JavaScriptSettings">
4
+    <option name="languageLevel" value="ES6" />
5
+  </component>
6
+</project>

+ 8
- 0
.idea/modules.xml View File

@@ -0,0 +1,8 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<project version="4">
3
+  <component name="ProjectModuleManager">
4
+    <modules>
5
+      <module fileurl="file://$PROJECT_DIR$/.idea/ZCW-PhoneBook.iml" filepath="$PROJECT_DIR$/.idea/ZCW-PhoneBook.iml" />
6
+    </modules>
7
+  </component>
8
+</project>

+ 6
- 0
.idea/vcs.xml View File

@@ -0,0 +1,6 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<project version="4">
3
+  <component name="VcsDirectoryMappings">
4
+    <mapping directory="" vcs="Git" />
5
+  </component>
6
+</project>

+ 243
- 0
.idea/workspace.xml View File

@@ -0,0 +1,243 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<project version="4">
3
+  <component name="ChangeListManager">
4
+    <list default="true" id="716ed771-3ce7-436f-ad83-f879902e7fba" name="Default" comment="">
5
+      <change beforePath="$PROJECT_DIR$/PhoneBook.java" beforeDir="false" afterPath="$PROJECT_DIR$/PhoneBook.java" afterDir="false" />
6
+      <change beforePath="$PROJECT_DIR$/PhoneBookTest.java" beforeDir="false" afterPath="$PROJECT_DIR$/PhoneBookTest.java" afterDir="false" />
7
+      <change beforePath="$PROJECT_DIR$/package.bluej" beforeDir="false" afterPath="$PROJECT_DIR$/package.bluej" afterDir="false" />
8
+    </list>
9
+    <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
10
+    <option name="TRACKING_ENABLED" value="true" />
11
+    <option name="SHOW_DIALOG" value="false" />
12
+    <option name="HIGHLIGHT_CONFLICTS" value="true" />
13
+    <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
14
+    <option name="LAST_RESOLUTION" value="IGNORE" />
15
+  </component>
16
+  <component name="FileEditorManager">
17
+    <leaf>
18
+      <file leaf-file-name="PhoneBook.java" pinned="false" current-in-tab="false">
19
+        <entry file="file://$PROJECT_DIR$/PhoneBook.java">
20
+          <provider selected="true" editor-type-id="text-editor">
21
+            <state relative-caret-position="540">
22
+              <caret line="36" column="4" selection-start-line="36" selection-start-column="4" selection-end-line="36" selection-end-column="4" />
23
+            </state>
24
+          </provider>
25
+        </entry>
26
+      </file>
27
+      <file leaf-file-name="README.md" pinned="false" current-in-tab="true">
28
+        <entry file="file://$PROJECT_DIR$/README.md">
29
+          <provider selected="true" editor-type-id="split-provider[text-editor;markdown-preview-editor]">
30
+            <state split_layout="SPLIT">
31
+              <first_editor relative-caret-position="-189" />
32
+              <second_editor />
33
+            </state>
34
+          </provider>
35
+        </entry>
36
+      </file>
37
+    </leaf>
38
+  </component>
39
+  <component name="Git.Settings">
40
+    <option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
41
+  </component>
42
+  <component name="IdeDocumentHistory">
43
+    <option name="CHANGED_PATHS">
44
+      <list>
45
+        <option value="$PROJECT_DIR$/PhoneBook.java" />
46
+      </list>
47
+    </option>
48
+  </component>
49
+  <component name="JsBuildToolGruntFileManager" detection-done="true" sorting="DEFINITION_ORDER" />
50
+  <component name="JsBuildToolPackageJson" detection-done="true" sorting="DEFINITION_ORDER" />
51
+  <component name="JsGulpfileManager">
52
+    <detection-done>true</detection-done>
53
+    <sorting>DEFINITION_ORDER</sorting>
54
+  </component>
55
+  <component name="NodePackageJsonFileManager">
56
+    <packageJsonPaths />
57
+  </component>
58
+  <component name="ProjectFrameBounds" extendedState="1">
59
+    <option name="x" value="85" />
60
+    <option name="y" value="23" />
61
+    <option name="width" value="962" />
62
+    <option name="height" value="724" />
63
+  </component>
64
+  <component name="ProjectView">
65
+    <navigator proportions="" version="1">
66
+      <foldersAlwaysOnTop value="true" />
67
+    </navigator>
68
+    <panes>
69
+      <pane id="ProjectPane">
70
+        <subPane>
71
+          <expand>
72
+            <path>
73
+              <item name="ZCW-PhoneBook" type="b2602c69:ProjectViewProjectNode" />
74
+              <item name="ZCW-PhoneBook" type="462c0819:PsiDirectoryNode" />
75
+            </path>
76
+          </expand>
77
+          <select />
78
+        </subPane>
79
+      </pane>
80
+      <pane id="PackagesPane" />
81
+      <pane id="Scope" />
82
+      <pane id="AndroidView" />
83
+    </panes>
84
+  </component>
85
+  <component name="PropertiesComponent">
86
+    <property name="WebServerToolWindowFactoryState" value="false" />
87
+    <property name="aspect.path.notification.shown" value="true" />
88
+    <property name="last_opened_file_path" value="$PROJECT_DIR$" />
89
+    <property name="nodejs_interpreter_path.stuck_in_default_project" value="undefined stuck path" />
90
+    <property name="nodejs_npm_path_reset_for_default_project" value="true" />
91
+  </component>
92
+  <component name="RunDashboard">
93
+    <option name="ruleStates">
94
+      <list>
95
+        <RuleState>
96
+          <option name="name" value="ConfigurationTypeDashboardGroupingRule" />
97
+        </RuleState>
98
+        <RuleState>
99
+          <option name="name" value="StatusDashboardGroupingRule" />
100
+        </RuleState>
101
+      </list>
102
+    </option>
103
+  </component>
104
+  <component name="RunManager">
105
+    <configuration default="true" type="Application" factoryName="Application">
106
+      <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
107
+    </configuration>
108
+    <configuration default="true" type="JUnit" factoryName="JUnit">
109
+      <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
110
+      <option name="ALTERNATIVE_JRE_PATH" />
111
+      <option name="PACKAGE_NAME" />
112
+      <option name="MAIN_CLASS_NAME" />
113
+      <option name="METHOD_NAME" />
114
+      <option name="TEST_OBJECT" value="class" />
115
+      <option name="VM_PARAMETERS" value="-ea" />
116
+      <option name="PARAMETERS" />
117
+      <option name="WORKING_DIRECTORY" value="%MODULE_WORKING_DIR%" />
118
+      <option name="PASS_PARENT_ENVS" value="true" />
119
+      <option name="TEST_SEARCH_SCOPE">
120
+        <value defaultName="singleModule" />
121
+      </option>
122
+      <patterns />
123
+    </configuration>
124
+    <configuration default="true" type="TestNG" factoryName="TestNG">
125
+      <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
126
+      <option name="ALTERNATIVE_JRE_PATH" />
127
+      <option name="SUITE_NAME" />
128
+      <option name="PACKAGE_NAME" />
129
+      <option name="MAIN_CLASS_NAME" />
130
+      <option name="METHOD_NAME" />
131
+      <option name="GROUP_NAME" />
132
+      <option name="TEST_OBJECT" value="CLASS" />
133
+      <option name="VM_PARAMETERS" value="-ea" />
134
+      <option name="PARAMETERS" />
135
+      <option name="WORKING_DIRECTORY" value="%MODULE_WORKING_DIR%" />
136
+      <option name="OUTPUT_DIRECTORY" />
137
+      <option name="PASS_PARENT_ENVS" value="true" />
138
+      <option name="TEST_SEARCH_SCOPE">
139
+        <value defaultName="singleModule" />
140
+      </option>
141
+      <option name="USE_DEFAULT_REPORTERS" value="false" />
142
+      <option name="PROPERTIES_FILE" />
143
+      <properties />
144
+      <listeners />
145
+    </configuration>
146
+  </component>
147
+  <component name="SvnConfiguration">
148
+    <configuration />
149
+  </component>
150
+  <component name="TaskManager">
151
+    <task active="true" id="Default" summary="Default task">
152
+      <changelist id="716ed771-3ce7-436f-ad83-f879902e7fba" name="Default" comment="" />
153
+      <created>1528403098938</created>
154
+      <option name="number" value="Default" />
155
+      <option name="presentableId" value="Default" />
156
+      <updated>1528403098938</updated>
157
+      <workItem from="1528403101098" duration="933000" />
158
+    </task>
159
+    <servers />
160
+  </component>
161
+  <component name="TimeTrackingManager">
162
+    <option name="totallyTimeSpent" value="933000" />
163
+  </component>
164
+  <component name="ToolWindowManager">
165
+    <frame x="85" y="23" width="962" height="724" extended-state="1" />
166
+    <editor active="true" />
167
+    <layout>
168
+      <window_info anchor="right" id="Palette" />
169
+      <window_info anchor="bottom" id="TODO" order="6" />
170
+      <window_info anchor="right" id="Palette&#9;" />
171
+      <window_info id="Image Layers" />
172
+      <window_info anchor="right" id="Capture Analysis" />
173
+      <window_info anchor="bottom" id="Event Log" side_tool="true" />
174
+      <window_info anchor="right" id="Maven Projects" />
175
+      <window_info anchor="bottom" id="Database Changes" show_stripe_button="false" />
176
+      <window_info anchor="bottom" id="Run" order="2" />
177
+      <window_info anchor="bottom" id="Version Control" />
178
+      <window_info anchor="bottom" id="Terminal" />
179
+      <window_info id="Capture Tool" />
180
+      <window_info id="Designer" />
181
+      <window_info active="true" content_ui="combo" id="Project" order="0" visible="true" weight="0.25" />
182
+      <window_info anchor="right" id="Database" />
183
+      <window_info id="Structure" order="1" side_tool="true" weight="0.25" />
184
+      <window_info anchor="right" id="Ant Build" order="1" weight="0.25" />
185
+      <window_info id="UI Designer" />
186
+      <window_info anchor="right" id="Theme Preview" />
187
+      <window_info anchor="bottom" id="Debug" order="3" weight="0.4" />
188
+      <window_info id="Favorites" side_tool="true" />
189
+      <window_info anchor="bottom" id="Find" order="1" />
190
+      <window_info anchor="right" id="Commander" internal_type="SLIDING" order="0" type="SLIDING" weight="0.4" />
191
+      <window_info anchor="bottom" id="Inspection" order="5" weight="0.4" />
192
+      <window_info anchor="right" content_ui="combo" id="Hierarchy" order="2" weight="0.25" />
193
+      <window_info anchor="bottom" id="Cvs" order="4" weight="0.25" />
194
+      <window_info anchor="bottom" id="Message" order="0" />
195
+    </layout>
196
+  </component>
197
+  <component name="TypeScriptGeneratedFilesManager">
198
+    <option name="version" value="1" />
199
+  </component>
200
+  <component name="VcsContentAnnotationSettings">
201
+    <option name="myLimit" value="2678400000" />
202
+  </component>
203
+  <component name="editorHistoryManager">
204
+    <entry file="file://$PROJECT_DIR$/PhoneBookTest.java">
205
+      <provider selected="true" editor-type-id="text-editor">
206
+        <state relative-caret-position="240">
207
+          <caret line="19" column="5" lean-forward="true" selection-start-line="19" selection-start-column="5" selection-end-line="19" selection-end-column="5" />
208
+        </state>
209
+      </provider>
210
+    </entry>
211
+    <entry file="file://$PROJECT_DIR$/PhoneBook.java">
212
+      <provider selected="true" editor-type-id="text-editor">
213
+        <state relative-caret-position="540">
214
+          <caret line="36" column="4" selection-start-line="36" selection-start-column="4" selection-end-line="36" selection-end-column="4" />
215
+        </state>
216
+      </provider>
217
+    </entry>
218
+    <entry file="file://$PROJECT_DIR$/README.md">
219
+      <provider selected="true" editor-type-id="split-provider[text-editor;markdown-preview-editor]">
220
+        <state split_layout="SPLIT">
221
+          <first_editor relative-caret-position="-189" />
222
+          <second_editor />
223
+        </state>
224
+      </provider>
225
+    </entry>
226
+  </component>
227
+  <component name="masterDetails">
228
+    <states>
229
+      <state key="ProjectJDKs.UI">
230
+        <settings>
231
+          <last-edited>1.8</last-edited>
232
+          <splitter-proportions>
233
+            <option name="proportions">
234
+              <list>
235
+                <option value="0.2" />
236
+              </list>
237
+            </option>
238
+          </splitter-proportions>
239
+        </settings>
240
+      </state>
241
+    </states>
242
+  </component>
243
+</project>

+ 32
- 1
PhoneBook.java View File

@@ -1,7 +1,38 @@
1
- 
1
+import java.util.*;
2 2
 
3 3
 /**
4 4
  * Created by leon on 1/23/18.
5 5
  */
6 6
 public class PhoneBook {
7
+    private String name, phoneNumber;
8
+    private Map<String, String> entries;
9
+
10
+    public PhoneBook(){
11
+        this.entries = new TreeMap<String, String> ();
12
+    }
13
+
14
+    public void add(String name, String phoneNumber){
15
+        this.entries.put(name, phoneNumber);
16
+
17
+    }
18
+
19
+    public void remove(String name){
20
+        this.entries.remove(name);
21
+    }
22
+
23
+
24
+    public void display(){
25
+
26
+        if (this.entries.isEmpty()) System.out.println("Empty");
27
+
28
+        for (Map.Entry<String,String> entry : entries.entrySet()){
29
+            String key = entry.getKey();
30
+            String value = entry.getValue();
31
+
32
+            System.out.println(key + " " + value);
33
+        }
34
+
35
+    }
36
+
37
+    
7 38
 }

+ 17
- 2
PhoneBookTest.java View File

@@ -1,5 +1,4 @@
1 1
 
2
-
3 2
 import static org.junit.Assert.*;
4 3
 import org.junit.After;
5 4
 import org.junit.Before;
@@ -39,4 +38,20 @@ public class PhoneBookTest
39 38
     public void tearDown()
40 39
     {
41 40
     }
42
-}
41
+
42
+    @ Test
43
+    public void Test(){
44
+        PhoneBook phone = new PhoneBook();
45
+        phone.add("Zebra", "111-222-333");
46
+
47
+    }
48
+
49
+    @Test
50
+    public void Test1(){
51
+
52
+        PhoneBook phone1 = new PhoneBook();
53
+        phone1.add("Cow", "222-333-444");
54
+        
55
+    }
56
+
57
+}

+ 25
- 8
package.bluej View File

@@ -1,10 +1,13 @@
1 1
 #BlueJ package file
2
-editor.fx.0.height=0
3
-editor.fx.0.width=0
4
-editor.fx.0.x=0
5
-editor.fx.0.y=0
2
+dependency1.from=PhoneBookTest
3
+dependency1.to=PhoneBook
4
+dependency1.type=UsesDependency
5
+editor.fx.0.height=722
6
+editor.fx.0.width=800
7
+editor.fx.0.x=464
8
+editor.fx.0.y=23
6 9
 objectbench.height=101
7
-objectbench.width=461
10
+objectbench.width=776
8 11
 package.divider.horizontal=0.6
9 12
 package.divider.vertical=0.8007380073800738
10 13
 package.editor.height=427
@@ -13,8 +16,8 @@ package.editor.x=427
13 16
 package.editor.y=143
14 17
 package.frame.height=600
15 18
 package.frame.width=800
16
-package.numDependencies=0
17
-package.numTargets=1
19
+package.numDependencies=1
20
+package.numTargets=2
18 21
 package.showExtends=true
19 22
 package.showUses=true
20 23
 project.charset=UTF-8
@@ -23,4 +26,18 @@ readme.name=@README
23 26
 readme.width=47
24 27
 readme.x=10
25 28
 readme.y=10
26
-
29
+target1.height=50
30
+target1.name=PhoneBookTest
31
+target1.showInterface=false
32
+target1.type=UnitTestTargetJunit4
33
+target1.width=100
34
+target1.x=100
35
+target1.y=40
36
+target2.association=PhoneBookTest
37
+target2.height=50
38
+target2.name=PhoneBook
39
+target2.showInterface=false
40
+target2.type=ClassTarget
41
+target2.width=100
42
+target2.x=70
43
+target2.y=70