SignedIntegerArray.st
author Claus Gittinger <cg@exept.de>
Thu, 09 Jun 2016 12:42:07 +0200
changeset 3900 d9f7c0265cc0
parent 3876 0af18f03d193
permissions -rw-r--r--
class: HTMLPrinterStream changed: #initialize lazy package dependency
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
601
9f043e153af4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     1
"
736
db164846b078 documentation
Claus Gittinger <cg@exept.de>
parents: 703
diff changeset
     2
 COPYRIGHT (c) 1997 by eXept Software AG
601
9f043e153af4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     3
	      All Rights Reserved
9f043e153af4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     4
9f043e153af4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     5
 This software is furnished under a license and may be used
9f043e153af4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     6
 only in accordance with the terms of that license and with the
9f043e153af4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
9f043e153af4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     8
 be provided or otherwise made available to, or used by, any
9f043e153af4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     9
 other person.  No title to or ownership of the software is
9f043e153af4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    10
 hereby transferred.
9f043e153af4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    11
"
1177
f81425b27be5 inheritance & documentation
Claus Gittinger <cg@exept.de>
parents: 736
diff changeset
    12
"{ Package: 'stx:libbasic2' }"
f81425b27be5 inheritance & documentation
Claus Gittinger <cg@exept.de>
parents: 736
diff changeset
    13
3731
ae262cb477e4 #FEATURE
Stefan Vogel <sv@exept.de>
parents: 3333
diff changeset
    14
"{ NameSpace: Smalltalk }"
ae262cb477e4 #FEATURE
Stefan Vogel <sv@exept.de>
parents: 3333
diff changeset
    15
1177
f81425b27be5 inheritance & documentation
Claus Gittinger <cg@exept.de>
parents: 736
diff changeset
    16
UnboxedIntegerArray variableSignedLongSubclass:#SignedIntegerArray
601
9f043e153af4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    17
	instanceVariableNames:''
9f043e153af4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    18
	classVariableNames:''
9f043e153af4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    19
	poolDictionaries:''
9f043e153af4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    20
	category:'Collections-Arrayed'
9f043e153af4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    21
!
9f043e153af4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    22
9f043e153af4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    23
!SignedIntegerArray class methodsFor:'documentation'!
9f043e153af4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    24
9f043e153af4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    25
copyright
9f043e153af4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    26
"
9f043e153af4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    27
 COPYRIGHT (c) 1997 by eXept Software AG
9f043e153af4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    28
	      All Rights Reserved
9f043e153af4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    29
9f043e153af4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    30
 This software is furnished under a license and may be used
9f043e153af4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    31
 only in accordance with the terms of that license and with the
9f043e153af4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    32
 inclusion of the above copyright notice.   This software may not
9f043e153af4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    33
 be provided or otherwise made available to, or used by, any
9f043e153af4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    34
 other person.  No title to or ownership of the software is
9f043e153af4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    35
 hereby transferred.
9f043e153af4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    36
"
9f043e153af4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    37
!
9f043e153af4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    38
9f043e153af4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    39
documentation
9f043e153af4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    40
"
703
a0a2d6178de4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
    41
    SignedIntegerArrays store 32bit signed integers in the range -16r80000000..16r7FFFFFFF.
601
9f043e153af4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    42
    In contrast to normal arrays (which store pointers to their elements),
1574
0c15fa756ca4 comments
Claus Gittinger <cg@exept.de>
parents: 1177
diff changeset
    43
    signedIntegerArrays store the values in a dense & compact way. 
601
9f043e153af4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    44
    Since the representation fits the underlying C-language systems representation
9f043e153af4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    45
    of signed int32's, this is also useful to pass bulk data to c primitive code.
9f043e153af4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    46
736
db164846b078 documentation
Claus Gittinger <cg@exept.de>
parents: 703
diff changeset
    47
    [memory requirements:]
db164846b078 documentation
Claus Gittinger <cg@exept.de>
parents: 703
diff changeset
    48
        OBJ-HEADER + (size * 4)
db164846b078 documentation
Claus Gittinger <cg@exept.de>
parents: 703
diff changeset
    49
601
9f043e153af4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    50
    [see also:]
736
db164846b078 documentation
Claus Gittinger <cg@exept.de>
parents: 703
diff changeset
    51
        ByteArray BooleanArray FloatArray DoubleArray Array
db164846b078 documentation
Claus Gittinger <cg@exept.de>
parents: 703
diff changeset
    52
        SignedWordArray WordArray IntegerArray LongIntegerArray
db164846b078 documentation
Claus Gittinger <cg@exept.de>
parents: 703
diff changeset
    53
        SignedLongIntegerArray
601
9f043e153af4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    54
9f043e153af4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    55
    [author:]
736
db164846b078 documentation
Claus Gittinger <cg@exept.de>
parents: 703
diff changeset
    56
        Claus Gittinger
601
9f043e153af4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    57
"
9f043e153af4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    58
! !
9f043e153af4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    59
2641
9093942ea3a8 faster elementByteSize query
Claus Gittinger <cg@exept.de>
parents: 1574
diff changeset
    60
!SignedIntegerArray class methodsFor:'queries'!
9093942ea3a8 faster elementByteSize query
Claus Gittinger <cg@exept.de>
parents: 1574
diff changeset
    61
9093942ea3a8 faster elementByteSize query
Claus Gittinger <cg@exept.de>
parents: 1574
diff changeset
    62
elementByteSize
3333
cbc36d6ab0fd class: WordArray
Claus Gittinger <cg@exept.de>
parents: 2641
diff changeset
    63
    "for bit-like containers, return the number of bytes stored per element.
cbc36d6ab0fd class: WordArray
Claus Gittinger <cg@exept.de>
parents: 2641
diff changeset
    64
     Here, 4 is returned"
cbc36d6ab0fd class: WordArray
Claus Gittinger <cg@exept.de>
parents: 2641
diff changeset
    65
2641
9093942ea3a8 faster elementByteSize query
Claus Gittinger <cg@exept.de>
parents: 1574
diff changeset
    66
    ^ 4
9093942ea3a8 faster elementByteSize query
Claus Gittinger <cg@exept.de>
parents: 1574
diff changeset
    67
9093942ea3a8 faster elementByteSize query
Claus Gittinger <cg@exept.de>
parents: 1574
diff changeset
    68
    "Created: / 15-09-2011 / 14:11:46 / cg"
3731
ae262cb477e4 #FEATURE
Stefan Vogel <sv@exept.de>
parents: 3333
diff changeset
    69
!
ae262cb477e4 #FEATURE
Stefan Vogel <sv@exept.de>
parents: 3333
diff changeset
    70
ae262cb477e4 #FEATURE
Stefan Vogel <sv@exept.de>
parents: 3333
diff changeset
    71
maxVal
3876
0af18f03d193 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 3865
diff changeset
    72
    "the maximum value which can be stored in instances of me.
0af18f03d193 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 3865
diff changeset
    73
     For SignedIntegerArrays, this is 2147483647, eg. 16r7FFFFFFF (largest 32bit signed int)"
3865
855b056c92e9 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 3731
diff changeset
    74
3731
ae262cb477e4 #FEATURE
Stefan Vogel <sv@exept.de>
parents: 3333
diff changeset
    75
    ^ 16r7FFFFFFF
3865
855b056c92e9 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 3731
diff changeset
    76
!
855b056c92e9 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 3731
diff changeset
    77
855b056c92e9 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 3731
diff changeset
    78
minVal
3876
0af18f03d193 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 3865
diff changeset
    79
    "the minimum value which can be stored in instances of me.
0af18f03d193 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 3865
diff changeset
    80
     For SignedIntegerArrays, this is -2147483648 eg. -16r80000000 (smallest 32bit signed int)"
3865
855b056c92e9 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 3731
diff changeset
    81
855b056c92e9 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 3731
diff changeset
    82
    ^ -16r80000000
2641
9093942ea3a8 faster elementByteSize query
Claus Gittinger <cg@exept.de>
parents: 1574
diff changeset
    83
! !
9093942ea3a8 faster elementByteSize query
Claus Gittinger <cg@exept.de>
parents: 1574
diff changeset
    84
601
9f043e153af4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    85
!SignedIntegerArray class methodsFor:'documentation'!
9f043e153af4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    86
9f043e153af4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    87
version
3731
ae262cb477e4 #FEATURE
Stefan Vogel <sv@exept.de>
parents: 3333
diff changeset
    88
    ^ '$Header$'
3876
0af18f03d193 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 3865
diff changeset
    89
!
0af18f03d193 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 3865
diff changeset
    90
0af18f03d193 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 3865
diff changeset
    91
version_CVS
0af18f03d193 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 3865
diff changeset
    92
    ^ '$Header$'
601
9f043e153af4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    93
! !
3333
cbc36d6ab0fd class: WordArray
Claus Gittinger <cg@exept.de>
parents: 2641
diff changeset
    94