eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'UnboxedIntegerArray':

Home

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

Class: UnboxedIntegerArray


Inheritance:

   Object
   |
   +--Collection
      |
      +--SequenceableCollection
         |
         +--ArrayedCollection
            |
            +--UninterpretedBytes
               |
               +--AbstractNumberVector
                  |
                  +--UnboxedIntegerArray
                     |
                     +--IntegerArray
                     |
                     +--LongIntegerArray
                     |
                     +--SignedIntegerArray
                     |
                     +--SignedLongIntegerArray
                     |
                     +--SignedWordArray
                     |
                     +--WordArray

Package:
stx:libbasic
Category:
Collections-Arrayed
Version:
rev: 1.5 date: 2019/03/24 11:27:09
user: cg
file: UnboxedIntegerArray.st directory: libbasic
module: stx stc-classLibrary: libbasic
Author:
Claus Gittinger

Description:


An abstract superclass for all unboxed integer classes.
In contrast to normal arrays (which store pointers to their elements),
unboxedIntegerArrays store the values in a dense & compact way. 
Since the representation fits corresponding underlying C-language representations,
these are also useful to pass bulk data to c primitive code.


Related information:

    ByteArray
    WordArray
    BooleanArray
    FloatArray
    DoubleArray
    Array
    IntegerArray
    LongIntegerArray
    SignedLongIntegerArray

Class protocol:

instance creation
o  new: size elementBitSize: nBitsPerElement signed: signedBoolean
return a new instance for size elements,
each holding an nBitsPerElement-sized integer.
With nBitsPerElement == 8, this returns a byteArray/signedByteArray,
with nBitsPerElement == 16, a word/signedWordArray
with nBitsPerElement == 32, an integer/signedIntegerArray
and with nBitsPerElement == 65, a longInteger/signedLongIntegerArray
Other sizes might be provided in the future.

usage example(s):

     self new:10 elementBitSize:8 signed:false
     self new:10 elementBitSize:8 signed:true
     self new:10 elementBitSize:16 signed:true
     self new:10 elementBitSize:64 signed:true

queries
o  isAbstract
Return if this class is an abstract class.
True is returned for UnboxedIntegerArray here; false for subclasses.
Abstract subclasses must redefine this again.


Instance protocol:

printing
o  printOn: aStream base: radix showRadix: showRadix
append a printed representation to aStream in the given number base.

queries
o  defaultElement

o  isValidElement: anObject
return true, if I can hold this kind of object

testing
o  isIntegerArray
return true if the receiver has integer elements.
These are Byte- and Integer arrays; both signed and unsigned



ST/X 7.2.0.0; WebServer 1.670 at bd0aa1f87cdd.unknown:8081; Tue, 23 Apr 2024 06:49:44 GMT