home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 4 / AACD04.ISO / AACD / Programming / lsEstuff / old_lists / xl.doc < prev    next >
Encoding:
Text File  |  1999-10-10  |  7.1 KB  |  405 lines

  1.  
  2. /* ------ CONTENTS ------ */
  3.  
  4. /* the xl#? inheriting class hierarchy by Leif_Salomonsson@swipnet.se */
  5. /* 990930 */
  6. /* listheader (xl#?) is NOT compatible with Exec List Headers */
  7. /* nodes ARE compatible with mln */
  8. /* check it out! :) */
  9. /* id like betatesters and examplewriters!! :) */
  10. /* !!emailware!! */
  11.  
  12.  
  13. xl./OBJECT xn
  14. xl./OBJECT xl_CPObj
  15. xl.first()
  16. xl.last()
  17. xl.addFirst()
  18. xl.addLast()
  19. xl.remFirst()
  20. xl.remLast()
  21. xl.remove()
  22. xl.insert()
  23. xl.count()
  24. xl.removeFastDisposeAll()
  25. xl.removeFastDispose()
  26. xl.addLastFastNew()
  27. xl.cloneFastNew()
  28. xl.fromExecList()
  29. xl.listInsert()
  30. xl.listAddFirst()
  31. xl.listAddLast()
  32. xl.trav()
  33. xl.travRev()
  34. xli./OBJECT xni
  35. xli./OBJECT xli_CPObj
  36. xli.ordInsert()
  37. xli.sort()
  38. xli.getSumID()
  39. xli.getMinID()
  40. xli.getMaxID()
  41. xli.find()
  42. xli.cmpMap()
  43. xli.scroll()
  44.  
  45. ----------------------
  46.  
  47. xl./xn
  48.  
  49.     OBJECT xn
  50.        next
  51.        prev
  52.     ENDOBJECT
  53.  
  54.  
  55. xl./xl_CPObj
  56.  
  57.     OBJECT xl_CPObj
  58.        node
  59.        list
  60.     ENDOBJECT
  61.  
  62.  
  63. xl.first()
  64.  
  65.      NAME
  66.           first()
  67.      SYNOPSIS
  68.           firstnode := xl.first()
  69.      FUNCTION
  70.           Get first node in list or NIL IF empty.
  71.      RESULT
  72.           PTR TO xn
  73.  
  74.  
  75. xl.last()
  76.  
  77.      NAME
  78.           last()
  79.      SYNOPSIS
  80.           lastnode := xl.last()
  81.      FUNCTION
  82.           Get last node in list or NIL IF empty.
  83.      RESULT
  84.           PTR TO xn
  85.  
  86. xl.addFirst()
  87.  
  88.      NAME
  89.           addFirst()
  90.      SYNOPSIS
  91.           addednode := xl.addFirst(xn:PTR TO xn)
  92.      FUNCTION
  93.           See exec.library/AddHead()
  94.  
  95.  
  96. xl.addLast()
  97.  
  98.      NAME
  99.           addLast()
  100.      SYNOPSIS
  101.           addednode := xl.addLast(xn:PTR TO xn)
  102.      FUNCTION
  103.           See exec.library/AddTail()
  104.  
  105. xl.remFirst()
  106.  
  107.      NAME
  108.           remFirst()
  109.      SYNOPSIS
  110.           remednode := xl.remFirst()
  111.      FUNCTION
  112.           See exec.library/RemHead()
  113.  
  114. xl.remLast()
  115.  
  116.      NAME
  117.           remLast()
  118.      SYNOPSIS
  119.           remednode := xl.remLast()
  120.      FUNCTION
  121.           See exec.library/RemTail()
  122.  
  123.  
  124. xl.addLast()
  125.  
  126.      NAME
  127.           addLast()
  128.      SYNOPSIS
  129.           addednode := xl.addLast(xn:PTR TO xn)
  130.      FUNCTION
  131.           See exec.library/addTail()
  132.  
  133.  
  134. xl.remove()
  135.  
  136.      NAME
  137.           remove()
  138.      SYNOPSIS
  139.           remednode := xl.remove(xn:PTR TO xn)
  140.      FUNCTION
  141.           See exec.library/Remove()
  142.  
  143.  
  144. xl.insert()
  145.  
  146.      NAME
  147.           insert()
  148.      SYNOPSIS
  149.           addednode := xl.insert(xn:PTR TO xn)
  150.      FUNCTION
  151.           See exec.library/Insert()
  152.  
  153.  
  154. xl.count()
  155.  
  156.      NAME
  157.           count()
  158.      SYNOPSIS
  159.           nrofnodes := xl.count()
  160.      FUNCTION
  161.           Get the number of nodes in list, NIL if empty.
  162.  
  163.  
  164. xl.removeFastDisposeAll()
  165.  
  166.      NAME
  167.           removeFastDisposeAll()
  168.      SYNOPSIS
  169.           xl.removeFastDisposeAll(nodesize)
  170.      FUNCTION
  171.           removes and frees (FastDispose) all nodes in list.
  172.      NOTES
  173.           all nodes must ofcource have the same size
  174.  
  175.  
  176. xl.removeFastDispose()
  177.  
  178.      NAME
  179.           removeFastDispose()
  180.      SYNOPSIS
  181.           xl.removeFastDispose(xn:PTR TO xn, nodesize)
  182.      FUNCTION
  183.           removes and frees (FastDispose)a node in list.
  184.  
  185.  
  186. xl.addLastFastNew()
  187.  
  188.      NAME
  189.           addLastFastNew()
  190.      SYNOPSIS
  191.           xl.addLastFastNew(nodesize)
  192.      FUNCTION
  193.           Allocates (FastNew) and adds a node to the list.
  194.      RESULT
  195.           PTR TO xn
  196.  
  197.  
  198. xl.cloneFastNew()
  199.  
  200.      NAME
  201.           cloneFastNew()
  202.      SYNOPSIS
  203.           clonedlist := xl.cloneFastNew(nodesize)
  204.      FUNCTION
  205.           Makes an exact copy of this list.
  206.      RESULT
  207.           PTR TO xl
  208.  
  209.  
  210. xl.fromExecList()
  211.  
  212.      NAME
  213.           fromExecList()
  214.      SYNOPSIS
  215.           xl.fromExecList(execlistheader:PTR TO lh)
  216.      FUNCTION
  217.           Make xl point to nodes in an ExecList (lh/mlh)
  218.      NOTES
  219.           xl must be emty before doing this or all old
  220.           nodes is lost! Be real careful with what methods
  221.           u use when obtaining an execlist! :)
  222.  
  223.  
  224. xl.looseNodes()
  225.  
  226.      NAME
  227.           looseNodes()
  228.      SYNOPSIS
  229.           xl.looseNodes()
  230.      FUNCTION
  231.           Make this list loose connection with its
  232.           nodes. Useful if u have attached an execlist
  233.           to it and want to get rid of it. the list
  234.           will be completely empty.
  235.  
  236.  
  237. xl.listInsert()
  238.  
  239.      NAME
  240.           listInsert()
  241.      SYNOPSIS
  242.           xl.listInsert(list:PTR TO xl, afterthis:PTR TO xn)
  243.      FUNCTION
  244.           Inserts a lists nodes into this.
  245.  
  246.  
  247. xl.listAddFirst()
  248.  
  249.      NAME
  250.           listAddFirst()
  251.      SYNOPSIS
  252.           xl.listAddFirst(list:PTR TO xl)
  253.      FUNCTION
  254.           Inserts a lists nodes into this. At the top.
  255.  
  256.  
  257. xl.listAddLast()
  258.  
  259.      NAME
  260.           listAddLast()
  261.      SYNOPSIS
  262.           xl.listAddLast(list:PTR TO xl)
  263.      FUNCTION
  264.           Inserts a lists nodes into this. At the bottom.
  265.  
  266.  
  267. xl.trav()
  268.  
  269.      NAME
  270.           trav()
  271.      SYNOPSIS
  272.           xl.trav(proc, cpobj:PTR TO xl_CPObj)
  273.      FUNCTION
  274.           This method calls proc for each node in the list
  275.           passing cpobj to the procedure.
  276.  
  277.  
  278. xl.travRev()
  279.  
  280.      NAME
  281.           travRev()
  282.      SYNOPSIS
  283.           xl.travRev(proc, cpobj:PTR TO xl_CPObj)
  284.      FUNCTION
  285.           Same as trav() except the traversing starts
  286.           from the bottom of the list.
  287.  
  288.  
  289. xli./xni
  290.  
  291.      OBJECT xni OF xn
  292.         id
  293.      ENDOBJECT
  294.  
  295. xli./xli_CPObj
  296.  
  297.      OBJECT xli_CPObj OF xl_CPObj
  298.      ENDOBJECT
  299.  
  300.  
  301. xli.ordInsert()
  302.  
  303.      NAME
  304.           ordInsert()
  305.      SYNOPSIS
  306.           xli.ordInsert(xni:PTR TO xni)
  307.      FUNCTION
  308.           Insert node in list. Position depends
  309.           on the xni.id field. Lowest value on top.
  310.      RESULT
  311.           PTR TO xni
  312.  
  313.  
  314. xli.sort()
  315.  
  316.      NAME
  317.           sort()
  318.      SYNOPSIS
  319.           xli.sort()
  320.      FUNCTION
  321.           Sort nodes by ID. lowest on top.
  322.      RESULT
  323.           NONE
  324.      NOTES
  325.           Simple bubblesort for the moment.
  326.  
  327.  
  328. xli.getSumID()
  329.  
  330.      NAME
  331.           getSumID()
  332.      SYNOPSIS
  333.           sumid := xli.getSumID()
  334.      FUNCTION
  335.           Returns the sum of all xni.id fields in list.
  336.  
  337.  
  338. xli.getMinID()
  339.  
  340.      NAME
  341.           getMinID()
  342.      SYNOPSIS
  343.           minid := xli.getMinID()
  344.      FUNCTION
  345.           Returns the lowest value on xni.id fields in list.
  346.  
  347.  
  348. xli.getMaxID()
  349.  
  350.      NAME
  351.           getMaxID()
  352.      SYNOPSIS
  353.           maxid := xli.getMaxID()
  354.      FUNCTION
  355.           Returns the highest value on xni.id fields in list.
  356.  
  357.  
  358. xli.find()
  359.  
  360.      NAME
  361.           find()
  362.      SYNOPSIS
  363.           node := xli.find(id, startnode=NIL)
  364.      FUNCTION
  365.           Finds a node in list with the requested id.
  366.           If startnode is specified then search starts
  367.           from there.
  368.      RESULT
  369.           PTR TO xni or NIL if not found.
  370.           
  371.  
  372. xli.cmpMap()
  373.  
  374.      NAME
  375.           cmpMap()
  376.      SYNOPSIS
  377.           bool := xli.cmpMap(xli:PTR TO xli)
  378.      FUNCTION
  379.           Checks if the lists are mapped the same way.
  380.      RESULT
  381.           TRUE if equal or FALSE.
  382.      NOTES
  383.           The lists MUST be sorted before using this!
  384.           (If u havent been clever using ordInsert())
  385.           (speed and simplicity issue)
  386.      SEE ALSO
  387.           xli.sort(), xli.ordInsert()
  388.  
  389.  
  390. xli.scroll()
  391.  
  392.      NAME
  393.           scroll()
  394.      SYNOPSIS
  395.           xli.scroll(amount)
  396.      FUNCTION
  397.           Scrolls all nodes by index (ID).
  398.           What it does is adding or subtracting
  399.           the xni.id variabel on all nodes in list.
  400.      NOTES
  401.           amount may be negative.
  402.  
  403.  
  404.  
  405.