eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'SmallIdentityDictionary':

Home

Documentation
www.exept.de
Everywhere
for:
[back]

Class: SmallIdentityDictionary


Inheritance:

   Object
   |
   +--Collection
      |
      +--KeyedCollection
         |
         +--SmallDictionary
            |
            +--SmallIdentityDictionary

Package:
stx:libbasic
Category:
Collections-Unordered
Version:
rev: 1.3 date: 2023/08/01 08:34:01
user: stefan
file: SmallIdentityDictionary.st directory: libbasic
module: stx stc-classLibrary: libbasic
Author:
Stefan Vogel

Description:


documentation to be added.

class:
    <a short class summary here, describing what instances represent>

responsibilities:    
    <describing what my main role is>

collaborators:    
    <describing with whom and how I talk to>

API:
    <public api and main messages>
    
example:
    <a one-line examples on how to use - can also be in a separate example method>

implementation:
    <implementation points>


[instance variables:]

[class variables:]


Related information:



Instance protocol:

comparing
o  = aSmallIdentityDictionary
return true, if the argument is an IdentityDictionary containing the same
key-value pairs as I do

private
o  indexOfKeyInArray: aKey
return the index of aKey

searching
o  indexOfKey: aKey
return the index of aKey


Examples:


Creation timing:

{SmallIdentityDictionary. IdentityDictionary. OrderedDictionary} do:[:eachClass|
    |keys values dict time|

    keys := #(aaaaa  bbbb cccc dddd ffff gggg hhhh jjjj kkkk llll).
    values := #(1 2 3 4 5 6 7 8 9 10).


    time := TimeDuration toRun:[
        1000000 timesRepeat:[
            dict := eachClass withKeys:keys andValues:values.
        ]
    ].
    Transcript showCR:(eachClass name, ' time: ', time printString).
]


Access timing:

{SmallIdentityDictionary. IdentityDictionary. OrderedDictionary} do:[:eachClass|
    |keys values dict time|

    keys := #(aaaaa  bbbb cccc dddd ffff gggg hhhh jjjj kkkk llll).
    values := #(1 2 3 4 5 6 7 8 9 10).

    dict := eachClass withKeys:keys andValues:values.

    time := TimeDuration toRun:[
        1000000 timesRepeat:[
            1 to:keys size do:[:idx|
                dict at:(keys at:idx)
            ]
        ]
    ].
    Transcript showCR:(eachClass name, ' time: ', time printString).
]


ST/X 7.7.0.0; WebServer 1.702 at 20f6060372b9.unknown:8081; Fri, 18 Oct 2024 04:47:16 GMT