if no unit is given in the readString, assume seconds.
"
COPYRIGHT (c) 1997 by eXept Software AG
All Rights Reserved
This software is furnished under a license and may be used
only in accordance with the terms of that license and with the
inclusion of the above copyright notice. This software may not
be provided or otherwise made available to, or used by, any
other person. No title to or ownership of the software is
hereby transferred.
"
"{ Package: 'stx:libbasic2' }"
UnboxedIntegerArray variableLongSubclass:#IntegerArray
instanceVariableNames:''
classVariableNames:''
poolDictionaries:''
category:'Collections-Arrayed'
!
!IntegerArray class methodsFor:'documentation'!
copyright
"
COPYRIGHT (c) 1997 by eXept Software AG
All Rights Reserved
This software is furnished under a license and may be used
only in accordance with the terms of that license and with the
inclusion of the above copyright notice. This software may not
be provided or otherwise made available to, or used by, any
other person. No title to or ownership of the software is
hereby transferred.
"
!
documentation
"
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)
[see also:]
ByteArray BooleanArray FloatArray DoubleArray Array
SignedWordArray WordArray
[author:]
Claus Gittinger
"
! !
!IntegerArray methodsFor:'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)"
%{ /* NOCONTEXT */
int len1, len2, min, i;
REGISTER OBJ s = anIntegerArray;
unsigned int *ip1, *ip2;
OBJ cls;
OBJ myCls;
if (__isNonNilObject(s)) {
cls = __qClass(s);
myCls = __qClass(self);
if ((cls == IntegerArray) || (cls == myCls)) {
ip2 = __integerArrayVal(s);
len2 = __integerArraySize(s);
/*
* care for instances of subclasses ...
*/
if (cls != IntegerArray) {
int n = __OBJS2BYTES__(__intVal(__ClassInstPtr(cls)->c_ninstvars)) / sizeof(__integerArrayVal(s));
ip2 += n;
len2 -= n;
}
ip1 = __integerArrayVal(self);
len1 = __integerArraySize(self);
/*
* care for instances of subclasses ...
*/
if (myCls != IntegerArray) {
int n = __OBJS2BYTES__(__intVal(__ClassInstPtr(myCls)->c_ninstvars)) / sizeof(__integerArrayVal(s));
ip1 += n;
len1 -= n;
}
if (len1 <= len2)
min = len1;
else
min = len2;
for (i = 0; i < min; i++) {
if (ip1[i] < ip2[i]) {
RETURN(true)
}
if (ip1[i] > ip2[i]) {
RETURN(false)
}
}
if (len1 < len2) {
RETURN ( true );
}
RETURN ( false );
}
}
%}.
^ super < anIntegerArray
"
(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])
"
! !
!IntegerArray class methodsFor:'documentation'!
version
^ '$Header: /cvs/stx/stx/libbasic2/IntegerArray.st,v 1.4 2004-04-12 16:37:53 stefan Exp $'
! !