LongIntegerArray.st
author Claus Gittinger <cg@exept.de>
Tue, 09 Jul 2019 20:55:17 +0200
changeset 24417 03b083548da2
parent 23964 54ca96b24b2b
permissions -rw-r--r--
#REFACTORING by exept class: Smalltalk class changed: #recursiveInstallAutoloadedClassesFrom:rememberIn:maxLevels:noAutoload:packageTop:showSplashInLevels: Transcript showCR:(... bindWith:...) -> Transcript showCR:... with:...
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
23964
54ca96b24b2b #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 20652
diff changeset
     1
"{ Encoding: utf8 }"
54ca96b24b2b #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 20652
diff changeset
     2
20652
9513ab0b635f initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     3
"
9513ab0b635f initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     4
 COPYRIGHT (c) 1998 by Claus Gittinger / eXept Software AG
9513ab0b635f initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     5
	      All Rights Reserved
9513ab0b635f initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     6
9513ab0b635f initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     7
 This software is furnished under a license and may be used
9513ab0b635f initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     8
 only in accordance with the terms of that license and with the
9513ab0b635f initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     9
 inclusion of the above copyright notice.   This software may not
9513ab0b635f initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    10
 be provided or otherwise made available to, or used by, any
9513ab0b635f initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    11
 other person.  No title to or ownership of the software is
9513ab0b635f initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    12
 hereby transferred.
9513ab0b635f initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    13
"
9513ab0b635f initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    14
"{ Package: 'stx:libbasic' }"
9513ab0b635f initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    15
9513ab0b635f initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    16
"{ NameSpace: Smalltalk }"
9513ab0b635f initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    17
9513ab0b635f initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    18
UnboxedIntegerArray variableLongLongSubclass:#LongIntegerArray
9513ab0b635f initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    19
	instanceVariableNames:''
9513ab0b635f initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    20
	classVariableNames:''
9513ab0b635f initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    21
	poolDictionaries:''
9513ab0b635f initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    22
	category:'Collections-Arrayed'
9513ab0b635f initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    23
!
9513ab0b635f initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    24
9513ab0b635f initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    25
!LongIntegerArray class methodsFor:'documentation'!
9513ab0b635f initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    26
9513ab0b635f initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    27
copyright
9513ab0b635f initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    28
"
9513ab0b635f initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    29
 COPYRIGHT (c) 1998 by Claus Gittinger / eXept Software AG
9513ab0b635f initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    30
	      All Rights Reserved
9513ab0b635f initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    31
9513ab0b635f initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    32
 This software is furnished under a license and may be used
9513ab0b635f initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    33
 only in accordance with the terms of that license and with the
9513ab0b635f initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    34
 inclusion of the above copyright notice.   This software may not
9513ab0b635f initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    35
 be provided or otherwise made available to, or used by, any
9513ab0b635f initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    36
 other person.  No title to or ownership of the software is
9513ab0b635f initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    37
 hereby transferred.
9513ab0b635f initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    38
"
9513ab0b635f initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    39
!
9513ab0b635f initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    40
9513ab0b635f initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    41
documentation
9513ab0b635f initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    42
"
9513ab0b635f initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    43
    LongIntegerArrays store 64bit unsigned integers in the range 
9513ab0b635f initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    44
    0..16rFFFFFFFFFFFFFFFF.
9513ab0b635f initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    45
    In contrast to normal arrays (which store pointers to their elements),
9513ab0b635f initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    46
    longIntegerArrays store the values in a dense & compact way. 
9513ab0b635f initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    47
    Since the representation fits the underlying C-language systems representation
9513ab0b635f initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    48
    of unsigned longlong's, this is also useful to pass bulk data to c primitive code.
9513ab0b635f initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    49
    (the system makes certain, that the first longlong is aligned as required)
9513ab0b635f initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    50
9513ab0b635f initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    51
    [memory requirements:]
9513ab0b635f initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    52
        OBJ-HEADER + (size * 8)
9513ab0b635f initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    53
9513ab0b635f initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    54
    [see also:]
9513ab0b635f initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    55
        ByteArray BooleanArray FloatArray DoubleArray Array
9513ab0b635f initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    56
        WordArray SignedWordArray IntegerArray SignedIntegerArray
9513ab0b635f initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    57
        SignedLongIntegerArray
9513ab0b635f initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    58
23964
54ca96b24b2b #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 20652
diff changeset
    59
    [caveat:]
54ca96b24b2b #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 20652
diff changeset
    60
        should probably be renamed to UnsignedInt64Array
54ca96b24b2b #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 20652
diff changeset
    61
20652
9513ab0b635f initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    62
    [author:]
9513ab0b635f initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    63
        Claus Gittinger
9513ab0b635f initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    64
"
9513ab0b635f initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    65
! !
9513ab0b635f initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    66
9513ab0b635f initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    67
!LongIntegerArray class methodsFor:'queries'!
9513ab0b635f initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    68
9513ab0b635f initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    69
elementByteSize
9513ab0b635f initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    70
    "for bit-like containers, return the number of bytes stored per element.
9513ab0b635f initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    71
     Here, 8 is returned"
9513ab0b635f initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    72
9513ab0b635f initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    73
    ^ 8
9513ab0b635f initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    74
9513ab0b635f initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    75
    "Created: / 15-09-2011 / 14:11:59 / cg"
9513ab0b635f initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    76
!
9513ab0b635f initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    77
9513ab0b635f initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    78
maxVal
9513ab0b635f initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    79
    "the maximum value which can be stored in instances of me.
9513ab0b635f initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    80
     For LongIntegerArrays, this is 18446744073709551615 eg. 16rFFFFFFFFFFFFFFFF 
9513ab0b635f initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    81
     (largest 64bit unsigned int)"
9513ab0b635f initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    82
9513ab0b635f initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    83
    ^ 16rFFFFFFFFFFFFFFFF
9513ab0b635f initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    84
!
9513ab0b635f initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    85
9513ab0b635f initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    86
minVal
9513ab0b635f initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    87
    "the minimum value which can be stored in instances of me.
9513ab0b635f initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    88
     For LongIntegerArrays, this is 0"
9513ab0b635f initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    89
9513ab0b635f initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    90
    ^ 0
9513ab0b635f initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    91
! !
9513ab0b635f initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    92
9513ab0b635f initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    93
!LongIntegerArray class methodsFor:'documentation'!
9513ab0b635f initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    94
9513ab0b635f initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    95
version
9513ab0b635f initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    96
    ^ '$Header$'
9513ab0b635f initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    97
!
9513ab0b635f initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    98
9513ab0b635f initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    99
version_CVS
9513ab0b635f initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   100
    ^ '$Header$'
9513ab0b635f initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   101
! !
9513ab0b635f initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   102