TwoByteString.st
changeset 1 a27a279701f8
child 3 24d81bf47225
equal deleted inserted replaced
0:aa2498ef6470 1:a27a279701f8
       
     1 "
       
     2  COPYRIGHT (c) 1993 by Claus Gittinger
       
     3               All Rights Reserved
       
     4 
       
     5  This software is furnished under a license and may be used
       
     6  only in accordance with the terms of that license and with the
       
     7  inclusion of the above copyright notice.   This software may not
       
     8  be provided or otherwise made available to, or used by, any
       
     9  other person.  No title to or ownership of the software is
       
    10  hereby transferred.
       
    11 "
       
    12 
       
    13 WordArray subclass:#TwoByteString
       
    14        instanceVariableNames:''
       
    15        classVariableNames:''
       
    16        poolDictionaries:''
       
    17        category:'Collections-Text'
       
    18 !
       
    19 
       
    20 TwoByteString comment:'
       
    21 
       
    22 COPYRIGHT (c) 1993 by Claus Gittinger
       
    23              All Rights Reserved
       
    24 
       
    25 TwoByteStrings are like strings, but storing 16bits per character.
       
    26 The integration of them into the system is not completed ....
       
    27 
       
    28 %W% %E%
       
    29 '!
       
    30 
       
    31 !TwoByteString class methodsFor:'instance creation'!
       
    32 
       
    33 basicNew:anInteger
       
    34     "return a new empty string with anInteger characters"
       
    35 
       
    36     ^ super basicNew:anInteger atAllPut:(Character space)
       
    37 ! !
       
    38 
       
    39 !TwoByteString methodsFor:'accessing'!
       
    40 
       
    41 basicAt:index
       
    42     "return the character at position index, an Integer
       
    43      - reimplemented here since we return characters"
       
    44 
       
    45     ^ Character value:(super basicAt:index)
       
    46 !
       
    47 
       
    48 basicAt:index put:aCharacter
       
    49     "store the argument, aCharacter at position index, an Integer
       
    50      - reimplemented here since we store characters"
       
    51 
       
    52     super basicAt:index put:(aCharacter asciiValue)
       
    53 ! !
       
    54 
       
    55 !TwoByteString methodsFor:'converting'!
       
    56 
       
    57 asString
       
    58     "return myself - I am a string"
       
    59 
       
    60     ^ self
       
    61 ! !