LinkedList.st
changeset 2146 27069b34fb5a
parent 1364 94e30904604e
child 2349 b68ab8aaabe1
equal deleted inserted replaced
2145:d243ffafeae3 2146:27069b34fb5a
    41     which can be used as elements of a linkedList.
    41     which can be used as elements of a linkedList.
    42 
    42 
    43     LinkedList does not care for storage; all it does is handling
    43     LinkedList does not care for storage; all it does is handling
    44     chained link elements, which must respond to #nextLink/#nextLink:.
    44     chained link elements, which must respond to #nextLink/#nextLink:.
    45     (i.e. any object which can do this, can be used as elements of a linked
    45     (i.e. any object which can do this, can be used as elements of a linked
    46     list).
    46      list). 
       
    47     An abstract superclass for linkElements is Link; a concrete class is
       
    48     ValueLink, which holds a reference to some object.
       
    49 
       
    50     [warning:]
       
    51         Be careful when subclassing Link, since there is a big drawback,
       
    52         which may be overlooked by beginners: 
       
    53             a Link element can only be in one LinkedList 
       
    54             - adding the same element to another LinkedList
       
    55             will remove it from the first as a side effect.
       
    56         Therefore, NEVER simply add something to a linkedList (except for
       
    57         valueLinks) unless you know what you do.
       
    58         The ST-80 implementors probably wanted this behavior, to move
       
    59         processes from the waitingList to runLists and vice versa;
       
    60         however, literature seems to not point this out enough.
    47 
    61 
    48     Although LinkedList is a subclass of SequenceableCollection (and therefore
    62     Although LinkedList is a subclass of SequenceableCollection (and therefore
    49     supports indexed access via at:), you should be careful in using it or
    63     supports indexed access via at:), you should be careful in using it or
    50     other methods based upon at:. 
    64     other methods based upon at:. 
    51     The reason is that #at: walks the linkedlist to find the indexed element
    65     The reason is that #at: walks the linkedlist to find the indexed element
    60     at the front and added at the end.
    74     at the front and added at the end.
    61     (the schedulers process handling code does this to manage process lists.)
    75     (the schedulers process handling code does this to manage process lists.)
    62 
    76 
    63     [author:]
    77     [author:]
    64         Claus Gittinger
    78         Claus Gittinger
       
    79 
       
    80     [see also:]
       
    81         Link ValueLink Process
    65 "
    82 "
    66 !
    83 !
    67 
    84 
    68 examples 
    85 examples 
    69 "
    86 "
   385 ! !
   402 ! !
   386 
   403 
   387 !LinkedList class methodsFor:'documentation'!
   404 !LinkedList class methodsFor:'documentation'!
   388 
   405 
   389 version
   406 version
   390     ^ '$Header: /cvs/stx/stx/libbasic/LinkedList.st,v 1.26 1996-05-09 14:26:36 cg Exp $'
   407     ^ '$Header: /cvs/stx/stx/libbasic/LinkedList.st,v 1.27 1997-01-11 12:16:08 cg Exp $'
   391 ! !
   408 ! !