﻿// JScript File

function List()
{
    var instance = this;
    var arr = new Array();
    this.getLength = function()
    {
        return arr.length;
    }
    this.add = function(strKey, obj)
    {
        if (instance.getItemByKey(strKey))
            throw "duplicate";
        arr.push (obj);
        instance[strKey] = obj;
    }
    this.getItemByIndex = function(index)
    {
        return arr[index];
    }
    this.getItemByKey = function(strKey)
    {
        return instance[strKey];
    }
}

