package org.joda.time;

import java.util.HashMap;

public class Pool {

    private static Pool myInstance;
    private HashMap<Integer, Months> months;
    private HashMap<Integer, Days> days;
    private HashMap<Integer, Minutes> minutes;
    private HashMap<Integer, Hours> hours;

    private Pool() {
        this.months = new HashMap<Integer, Months>();
        this.days = new HashMap<Integer, Days>();
        this.minutes = new HashMap<Integer, Minutes>();
        this.hours = new HashMap<Integer, Hours>();
    }

    public static Pool getInstance() {

        if (myInstance == null) {
            myInstance = new Pool();
        }

        return myInstance;
    }

    public static Months retrieveMonths(int numeral) {
        Pool pool = Pool.getInstance();

        Object result = pool.getMonths(numeral);

        if (result == null) {
            result =  new Months(numeral);
            pool.addMonth(numeral, (Months) result);
        }

        return (Months) result;
    }

    public static Days retrieveDays(int numeral) {
        Pool pool = Pool.getInstance();

        Object result = pool.getDays(numeral);

        if (result == null) {
            result =  new Days(numeral);
            pool.addDay(numeral, (Days) result);
        }

        return (Days) result;
    }


    public static Minutes retrieveMinutes(int numeral) {

        Pool pool = Pool.getInstance();

        Object result = pool.getMinutes(numeral);

        if (result == null) {
            result =  new Minutes(numeral);
            pool.addMinutes(numeral, (Minutes) result);
        }

        return (Minutes) result;
    }

    public static Hours retrieveHours(int numeral) {

        Pool pool = Pool.getInstance();

        Object result = pool.getHours(numeral);

        if (result == null) {
            result =  new Hours(numeral);
            pool.addHours(numeral, (Hours) result);
        }

        return (Hours) result;
    }

    private void addMonth(int numeral, Months month) {
        months.put(new Integer(numeral), month);
    }

    private void addDay(int numeral, Days day) {
        days.put(new Integer(numeral), day);
    }

    private void addMinutes(int numeral, Minutes minute) {
        minutes.put(new Integer(numeral), minute);
    }

    private void addHours(int numeral, Hours hour) {
        hours.put(new Integer(numeral), hour);
    }

    private Object getMonths(int numeral){
        Object instance = months.get(new Integer(numeral));

        return instance;
    }

    private Object getDays(int numeral){
        Object instance = days.get(new Integer(numeral));

        return instance;
    }

    private Object getMinutes(int numeral) {
        Object instance = minutes.get(new Integer(numeral));

        return instance;
    }

    private Object getHours(int numeral) {
        Object instance = hours.get(new Integer(numeral));

        return instance;
    }
}

@@ -220,23 +220,19 @@
 er, 
-Minutes%3E minute
+Hours%3E hour
 s;%0A 
@@ -259,27 +259,31 @@
 nteger, 
-Hours%3E hour
+Minutes%3E minute
 s;%0A%0A    
@@ -416,22 +416,20 @@
    this.
-minute
+hour
 s = new 
@@ -445,22 +445,20 @@
 nteger, 
-Minute
+Hour
 s%3E();%0A  
@@ -460,36 +460,38 @@
 );%0A        this.
-hour
+minute
 s = new HashMap%3C
@@ -491,36 +491,38 @@
 ashMap%3CInteger, 
-Hour
+Minute
 s%3E();%0A    %7D%0A%0A   
@@ -1304,17 +1304,16 @@
 %0A    %7D%0A%0A
-%0A
     publ
@@ -1322,22 +1322,20 @@
  static 
-Minute
+Hour
 s retrie
@@ -1336,22 +1336,20 @@
 retrieve
-Minute
+Hour
 s(int nu
@@ -1431,22 +1431,20 @@
 pool.get
-Minute
+Hour
 s(numera
@@ -1504,22 +1504,20 @@
  =  new 
-Minute
+Hour
 s(numera
@@ -1540,22 +1540,20 @@
 pool.add
-Minute
+Hour
 s(numera
@@ -1556,22 +1556,20 @@
 meral, (
-Minute
+Hour
 s) resul
@@ -1599,22 +1599,20 @@
 return (
-Minute
+Hour
 s) resul
@@ -1631,36 +1631,38 @@
   public static 
-Hour
+Minute
 s retrieveHours(
@@ -1647,36 +1647,38 @@
 Minutes retrieve
-Hour
+Minute
 s(int numeral) %7B
@@ -1744,36 +1744,38 @@
 esult = pool.get
-Hour
+Minute
 s(numeral);%0A%0A   
@@ -1819,36 +1819,38 @@
   result =  new 
-Hour
+Minute
 s(numeral);%0A    
@@ -1857,36 +1857,38 @@
         pool.add
-Hour
+Minute
 s(numeral, (Hour
@@ -1875,36 +1875,38 @@
 nutes(numeral, (
-Hour
+Minute
 s) result);%0A    
@@ -1920,36 +1920,38 @@
         return (
-Hour
+Minute
 s) result;%0A    %7D
@@ -2156,32 +2156,139 @@
 ), day);%0A    %7D%0A%0A
+    private void addHours(int numeral, Hours hour) %7B%0A        hours.put(new Integer(numeral), hour);%0A    %7D%0A%0A
     private void
@@ -2392,115 +2392,8 @@
  %7D%0A%0A
-    private void addHours(int numeral, Hours hour) %7B%0A        hours.put(new Integer(numeral), hour);%0A    %7D%0A%0A
     
@@ -2678,22 +2678,20 @@
 ject get
-Minute
+Hour
 s(int nu
@@ -2725,22 +2725,20 @@
 tance = 
-minute
+hour
 s.get(ne
@@ -2805,36 +2805,38 @@
 ivate Object get
-Hour
+Minute
 s(int numeral) %7B
@@ -2854,36 +2854,38 @@
 ject instance = 
-hour
+minute
 s.get(new Intege

rearrange code in chronological order