import java.util.HashMap; import java.util.Map; public class Plans { private HashMap plans; public Plans(){ plans = new HashMap(); } public Boolean Write(String[] str){ if (str == null){ return false; } MyDate myDate = new MyDate(); plans.put(str, myDate); return true; } public void Read(){ for (Map.Entry entry : plans.entrySet()){ System.out.print(entry.getValue().Year + "-"); if (entry.getValue().Month < 10){ System.out.print("0" + entry.getValue().Month + "-"); } else { System.out.print(entry.getValue().Month + "-"); } if (entry.getValue().Day < 10){ System.out.print("0" + entry.getValue().Day + " "); } else { System.out.print(entry.getValue().Day + " "); } for (int i = 0; i < entry.getKey().length; i++) { if (entry.getKey()[i] != null) { System.out.print(entry.getKey()[i] + " "); } else break; } System.out.println(); } } }