# HG changeset patch # User axmo # Date 1219831221 -32400 # Node ID 479c52c7de0b01e6c1a8bfd7d945056322501e83 # Parent 39f1d08528eff3bea61b9928500b8803e1e793c4 add idea that HashMap diff -r 39f1d08528ef -r 479c52c7de0b tools/java3d-test/src/HashMapSample.java --- /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 map){ + for (String str : map.keySet()){ + System.out.println(str + ": " + map.get(str)); + } + } + + public static void main(String[] args){ + //HashMapのインスタンス化 + Map map = new HashMap(); + + 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); + + + } + +}