Squeak Class Documentation category index | class index  
 
LinkedList
  category: Collections-Sequenceable
  superclass: SequenceableCollection
  subclasses: Semaphore

I represent a collection of links, which are containers for other objects. Using the message sequence addFirst:/removeLast causes the receiver to behave as a stack; using addLast:/removeFirst causes the receiver to behave as a queue.

instance methods
  accessing
  first
last

  adding
  add:
addFirst:
addLast:

  enumerating
  do:

  removing
  remove:ifAbsent:
removeFirst
removeLast

  testing
  isEmpty

class methods
  no messages
 

instance methods
  accessing top  
 

first

Answer the first link. Create an error notification if the receiver is
empty.


 

last

Answer the last link. Create an error notification if the receiver is
empty.


  adding top  
 

add:

Add aLink to the end of the receiver's list. Answer aLink.


 

addFirst:

Add aLink to the beginning of the receiver's list. Answer aLink.


 

addLast:

Add aLink to the end of the receiver's list. Answer aLink.


  enumerating top  
 

do:

Refer to the comment in Collection|do:.


  removing top  
 

remove:ifAbsent:

Remove aLink from the receiver. If it is not there, answer the result of
evaluating aBlock.


 

removeFirst

Remove the first element and answer it. If the receiver is empty, create
an error notification.


 

removeLast

Remove the receiver's last element and answer it. If the receiver is
empty, create an error notification.


  testing top  
 

isEmpty

Answer whether the receiver contains any elements.


class methods
  no messages top