home *** CD-ROM | disk | FTP | other *** search
- class huang.HighList
- {
- var items;
- function HighList(ListLength, initValue)
- {
- this.items = new Array(ListLength);
- if(initValue != undefined)
- {
- var _loc2_ = 0;
- _loc2_ = 0;
- while(_loc2_ < ListLength)
- {
- this.items[_loc2_] = initValue;
- _loc2_ = _loc2_ + 1;
- }
- }
- }
- function Sortby(filed)
- {
- if(this.items.length > 0)
- {
- this.items.sortOn(filed,Array.DESCENDING | Array.NUMERIC);
- }
- }
- function Insert(yourItem, compare)
- {
- if(this.items.length > 0)
- {
- this.Sortby(compare);
- var _loc2_ = 0;
- while(_loc2_ < this.items.length)
- {
- if(int(yourItem[compare]) >= int(this.items[_loc2_][compare]))
- {
- this.items[this.items.length - 1] = yourItem;
- this.Sortby(compare);
- return _loc2_;
- }
- _loc2_ = _loc2_ + 1;
- }
- return -1;
- }
- this.items[0] = yourItem;
- return 0;
- }
- function getIndex(yourNum, ToBeCheckNum)
- {
- if(this.items.length > 0)
- {
- var _loc2_ = 0;
- while(_loc2_ < this.items.length)
- {
- if(yourNum < this.items[_loc2_].ToBeCheckNum)
- {
- }
- _loc2_ = _loc2_ + 1;
- }
- }
- this.items[0] = yourNum;
- return 0;
- }
- }
-