Back: LargeZeroInteger-printing Up: Base classes Forward: Link class-instance creation   Top: GNU Smalltalk Library Reference Contents: Table of Contents Index: Class index About: About this document

1.101 Link

Defined in namespace Smalltalk
Superclass: Object
Category: Collections-Sequenceable
I represent simple linked lists. Generally, I am not used by myself, but rather a subclass adds other instance variables that hold the information for each node, and I hold the glue that keeps them together.

1.101.1 Link class: instance creation  (class)
1.101.2 Link: basic  (instance)
1.101.3 Link: iteration  (instance)


1.101.1 Link class: instance creation

nextLink: aLink
Create an instance with the given next link


1.101.2 Link: basic

nextLink
Answer the next item in the list

nextLink: aLink
Set the next item in the list


1.101.3 Link: iteration

at: index
Retrieve a node (instance of Link) that is at a distance of `index' after the receiver.

at: index put: object
This method should not be called for instances of this class.

do: aBlock
Evaluate aBlock for each element in the list

size
Answer the number of elements in the list. Warning: this is O(n)



Back: Link-basic Up: Link Forward: LinkedList   Top: GNU Smalltalk Library Reference Contents: Table of Contents Index: Class index About: About this document


This document was generated on August, 19 2010 using texi2html