|
Class: CharacterDictionary
Object
|
+--Collection
|
+--CharacterDictionary
- Package:
- stx:libbasic2
- Category:
- Collections-Ordered
- Version:
- rev:
1.4
date: 2021/11/25 17:41:19
- user: cg
- file: CharacterDictionary.st directory: libbasic2
- module: stx stc-classLibrary: libbasic2
- Author:
- cg
a very special dictionary-like collection,
which effectively maps characters to values.
API:
the API is similar to a dictionary, but only characters
are allowed as keys.
implementation:
uses fast direct indexed access instead of hashing
[instance variables:]
{InstanceVariable: pages Class: Array}
Dictionary
CharacterSet
instance creation
-
new
-
return an initialized instance
accessing
-
at: aCharacter
-
(comment from inherited method)
return the indexed instance variable with index, anInteger;
this method can be redefined in subclasses.
-
at: aCharacter ifAbsent: exceptionValue
-
}
-
at: aCharacter put: something
-
}
-
growPagesTo: pageIndex
-
enumerating
-
do: aBlock
-
(comment from inherited method)
evaluate the argument, aBlock for each element.
Return the receiver
(subclasses should care to also return the receiver,
in case do: is used in a chain of messages.)
-
keysAndValuesDo: aTwoArgBlock
-
(comment from inherited method)
evaluate the argument, aBlock for every element in the collection,
passing both index and element as arguments.
Blocked here - must be redefined in subclasses which have keyed elements
initialization
-
initialize
-
(comment from inherited method)
just to ignore initialize to objects which do not need it
queries
-
size
-
|