⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sortlist.m

📁 仿真人工金融市场Jackson代码
💻 M
字号:
//  SortList.m//  This file defines the methods for working with a sorted list.  It is//    specially designed for a clearing info object at this point.//#import "SortList.h"// Implementation of a Sorted list object@implementation SortList +create: aZone {  list = [List create: [self getZone]];  return self;}-addAscend: (id) c {  ClearingInfo *aClearInfo;  id index;  if ([list getCount] != 0 ) {    index = [(id) list begin: scratchZone];    while ((aClearInfo = [index next])) {      // if <= then add in front      if ([c getPricePoint] <= [aClearInfo getPricePoint]) {        [index addBefore: c];        break;      }    }    [index drop];    // if we got to the end of the list, index will be    //   nil, but the trader won't be on teh list    if (aClearInfo == nil)      [list addLast: c];   } else  // this is the first      [list addLast: c];        return self;}-print {  printf ("NOT YET IMPLEMENTED.\n");  return self;}#if 0-begin: (id) aZone {  return  [list begin: aZone];}-getCount {  return ((int) [list getCount]);}-deleteAll {  [list deleteAll];  return self;}#endif@end

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -