|
Class: IntegerArray
Object
|
+--Collection
|
+--SequenceableCollection
|
+--ArrayedCollection
|
+--UninterpretedBytes
|
+--AbstractNumberVector
|
+--UnboxedIntegerArray
|
+--IntegerArray
- Package:
- stx:libbasic
- Category:
- Collections-Arrayed
- Version:
- rev:
1.4
date: 2019/03/24 11:26:44
- user: cg
- file: IntegerArray.st directory: libbasic
- module: stx stc-classLibrary: libbasic
- Author:
- Claus Gittinger
IntegerArrays store integers in the range 0..16rFFFFFFFF.
In contrast to normal arrays (which store pointers to their elements),
integerArrays store the values in a dense & compact way.
Since the representation fits the underlying C-language systems representation
of unsigned int32's, this is also useful to pass bulk data to c primitive code.
[memory requirements:]
OBJ-HEADER + (size * 4)
[caveat:]
should probably be renamed to UnsignedInt32Array
ByteArray
BooleanArray
FloatArray
DoubleArray
Array
SignedWordArray
WordArray
queries
-
elementByteSize
-
for bit-like containers, return the number of bytes stored per element.
Here, 4 is returned
-
maxVal
-
the maximum value which can be stored in instances of me
-
minVal
-
the minimum value which can be stored in instances of me
accessing
-
unsignedInt32At: index MSB: msb
-
return the 4-bytes starting at index as an (unsigned) Integer.
The index is a smalltalk index (i.e. 1-based).
The value is retrieved MSB (high 8 bits at lower index) if msb is true;
LSB-first (i.e. low 8-bits at lower byte index) if it's false.
Notice:
the index is a byte index; thus, this allows for unaligned access to
words on any boundary.
usage example(s):
#(16r0201 16r0403 16r0605) asIntegerArray unsignedInt32At:1 MSB:false
#(16r0201 16r0403 16r0605) asIntegerArray unsignedInt32At:5 MSB:false
#(16r0201 16r0403 16r0605) asIntegerArray unsignedInt32At:9 MSB:false
#(16r0201 16r0403 16r0605) asIntegerArray unsignedInt32At:2 MSB:false
#(16r0201 16r0403 16r0605) asIntegerArray unsignedInt32At:3 MSB:false
#(16r0201 16r0403 16r0605) asIntegerArray unsignedInt32At:4 MSB:false
#(16rFFEE 16r0403 16r0605) asIntegerArray unsignedInt32At:1 MSB:false
#(16rFFEE 16r0403 16r0605) asIntegerArray unsignedInt32At:1 MSB:true
|
comparing
-
< anIntegerArray
-
Compare the receiver with the argument and return true if the
receiver is greater than the argument. Otherwise return false.
Redefined for speed (xpath handling)
usage example(s):
(IntegerArray newFrom:#[1 2 3 4 5]) < (IntegerArray newFrom:#[1 2 3 4 5])
(IntegerArray newFrom:#[1 2 3 4 5]) < (IntegerArray newFrom:#[1 2 3 4])
(IntegerArray newFrom:#[1 2 3 4]) < (IntegerArray newFrom:#[1 2 3 4 5])
(IntegerArray newFrom:#[1 2 3 4 5]) < (IntegerArray newFrom:#[1 2 3 4 6])
(IntegerArray newFrom:#[]) < (IntegerArray newFrom:#[1 2 3 4 6])
|
converting
-
asIntegerArray
-
return a new IntegerArray with the collection's elements.
That's the receiver itself here
|