author suo
  class SimpleMap < T > { public constructor ( ) { } public get keys ( ) : string [ ] { return Object . getOwnPropertyNames ( this ) ; } param key param value public set ( key , value ) { this [ key ] = value ; } param key return public get ( key ) { if ( this . isExist ( key ) ) { return this [ key ] ; } else { return null ; } } param key return public getByKeyIndex ( index ) { return this [ this . keys [ index ] ] ; } /**
     * 是否存在该键
     */ public isExist ( key ) { let result = this [ key ] ; if ( result === void 0 ) { return false ; } else { return true ; } } /**
     * 获得字典长度
     */ public get length ( ) : number { return this . keys . length ; } param key return public remove ( key ) { if ( this . isExist ( key ) ) { delete this [ key ] ; return true ; } else { return false ; } } /**
     * 清理
     */ public clear ( ) { let keys = this . keys . slice ( ) ; for ( let i = 0 ; i < keys . length ; i ++ ) { delete this [ keys [ i ] ] ; } } /**
     * 回收
     */ public recover ( ) { this . clear ( ) ; Pool . recover ( "simple_map" , this ) ; } /**
     * 拷贝字典
     */ public copy ( ) { let map = Pool . getItemByClass ( "simple_map" , SimpleMap ) ; let keys = this . keys . slice ( ) ; for ( let i = 0 ; i < keys . length ; i ++ ) { map . set ( keys [ i ] , this [ keys [ i ] ] ) ; } return map ; } }