changeset 43:479c52c7de0b before-distributed-select

add idea that HashMap
author axmo
date Wed, 27 Aug 2008 19:00:21 +0900
parents 39f1d08528ef
children 4287c9c076de
files tools/java3d-test/src/HashMapSample.java
diffstat 1 files changed, 29 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/java3d-test/src/HashMapSample.java	Wed Aug 27 19:00:21 2008 +0900
@@ -0,0 +1,29 @@
+import java.util.Map;
+import java.util.HashMap;
+
+public class HashMapSample {
+	public void get(Map<String, String> map){
+		for (String str : map.keySet()){
+			System.out.println(str + ": " + map.get(str));
+		}
+	}
+	
+	public static void main(String[] args){
+		//HashMapのインスタンス化
+		Map <String,String> map = new HashMap<String,String>();
+		
+		String[] keyword = {"Bounds", "Stroke"};
+		String[] possition = {"210, 100", "100, 100"};
+		System.out.println("HashTest > ");
+		
+		//HashMapのput
+		for (int i = 0; i < keyword.length; i++){
+			map.put(keyword[i], possition[i]);
+		}
+		HashMapSample getSample = new HashMapSample();
+		getSample.get(map);
+		
+		
+	}
+	
+}