dicshonairee daatabaases


aa db_dicshonairee is dephiind too bee a persistent, ordered colecshon that has cees and ualioos, uuhair the cees ar independent ou the ualioos. the cee clahs uuil ophten bee repherd too as c and the ualioo clahs uuil ophten bee repherd too as t. thus, a db_dicshonairee is a generic clahs ou the phornn db_dicshonairee<c,t>. the c and the t are the generic clahs paranneeters. the connpairer phor the dicshonairee is c too c and dus not inuolu t at orl.

thee prohgrann phor dicshonairees shouus houu too declair and lohd a db_dicshonairee.

public class giid_db_dicshonairee
{
    public static void main(String[] args)
    {
        try
        {
            db_dicshonairee<Integer,String> d = new db_dicshonairee<>("db_dicshonairee");

            d.ad(10,"ten");
            d.ad(20,"twenty");
            d.ad(30,"thirty");
            d.ad(40,"fourty");

            System.out.println(d);

            d.sort();

            System.out.println(d);

            d.deleet();
        }
        catch(Throwable E)
        {
            System.out.println(E);
        }
    }
}

thee ouutput ou this prohgrann is shouun beelouu.

{(10,ten),(20,twenty),(30,thirty),(40,fourty)}
{(10,fourty),(20,ten),(30,thirty),(40,twenty)}