<html>
<head>
<script type="text/javascript">
// Authors Birdshome, South@Official website Revised phito, Peng Haitao
= function()
{
var objClone;
if ( == Object ) objClone = new ();
else objClone = new (());
for ( var key in this )
{
if ( objClone[key] != this[key] )
{
if ( typeof(this[key]) == 'object' )
{
objClone[key] = this[key].Clone();
}
else
{
objClone[key] = this[key];
}
}
}
= ;
= ;
return objClone;
}
function Hashtable() {
= hashtable_clear;
= hashtable_containsKey;
= hashtable_containsValue;
= hashtable_get;
= hashtable_isEmpty;
= hashtable_keys;
= hashtable_put;
= hashtable_remove;
= hashtable_size;
= hashtable_toString;
= hashtable_values;
= new Object();
= hashtable_set;
= hashtable_valueOf;
= hashtable_clone;
= true;
//Is case ignoring
}
/*=======Private methods for internal use only========*/
function hashtable_clone(){
return ();
}
function hashtable_put(key, value) {
if ( && typeof(key) == "string") {
key = ();
}
if (key == null || value == null) {
throw "NullPointerException {" + key + "},{" + value + "}";
} else {
[key] = value;
}
}
function hashtable_set(key, value) {
if ( && typeof(key) == "string") {
key = ();
}
if ((key)) {
(key);
}
(key, value);
}
function hashtable_get(key) {
if ( && typeof(key) == "string") {
key = ();
}
return [key];
}
function hashtable_valueOf(key, defvalue) {
var ret = (key);
if (typeof(ret) == "undefined") {
return defvalue;
}
return ret;
}
function hashtable_remove(key) {
if ((key)) {
delete [key] ;
}
}
function hashtable_isEmpty() {
return (parseInt(()) == 0) ? true: false;
}
function hashtable_size() {
var size = 0;
for (var i in ) {
if(typeof([i])=="function"){
continue;
}
if ([i] != null) {
size++;
}
}
return size;
}
function hashtable_toString() {
var result = "";
for (var i in ) {
if(typeof([i])=="function"){
continue;
}
if ([i] != null) {
result += "{" + i + ":" + [i] + "}\n";
}
}
return result;
}
function hashtable_clear() {
= new Object();
}
function hashtable_containsKey(key) {
if ( && typeof(key) == "string") {
key = ();
}
var exists = false;
for (var i in ) {
if(typeof([i])=="function"){
continue;
}
if (i == key && [i] != null) {
exists = true;
break;
}
}
return exists;
}
function hashtable_containsValue(value) {
var contains = false;
if (value != null) {
for (var i in ) {
if(typeof([i])=="function"){
continue;
}
if ([i] == value) {
contains = true;
break;
}
}
}
return contains;
}
function hashtable_values() {
var values = new Object();
for (var i in ) {
if(typeof([i])=="function"){
continue;
}
if ([i] != null) ([i]);
}
return values;
}
function hashtable_keys() {
var keys = new Object();
for (var i in ) {
if(typeof([i])=="function"){
continue;
}
(i);
}
return keys;
}
function test() {
var ht = new Hashtable();
("3", "Jackson");
("2", "Tom");
("4", 3);
("length", 445555);
("ddd", "ddd");
("index", "ddd");
var et = ();
= false;
//Ignore case
();
("3", "Jackson");
("2", "Tom");
("2");
("4", 3);
("length", 5);
//If you use new Array, this item will set the length of the Array
("index", "ddd");
("ddd", "ddd");
alert(et + "" + () + "" + ());
var cloneobj=();
alert(());
}
</script>
</head>
<body onload="test()">
</body>
</html>