|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
Objectcommon:Array
common:ArrayArray
class
Generic Array dynamic array object wrapper.
This is a generic dynamic array wrapper class for Array data. Note that with this, you can create arrays of arrays, with each nested array having a possibly different number of elements. You can also create arrays of arrays of arrays.
See the Array base class for more information.
class ArrayArray(Array) {
; Generic Array dynamic array object wrapper.
; <p>
; This is a generic dynamic array wrapper class for
; Array data. Note that with this, you can create
; arrays of arrays, with each nested array having
; a possibly different number of elements. You can
; also create arrays of arrays of arrays.
; <p>
; See the Array base class for more information.
public:
; Constructor
;
; @param plength initial length of the array
func ArrayArray(int plength)
setLength(m_Elements, plength)
endfunc
; Length wrapper
;
; @return the number of elements in the array
int func GetArrayLength()
return length(m_Elements)
endfunc
; setLength wrapper
; <p>
; This is analagous to UF's native setLength() function
; for dynamic arrays.
;
; @param plength new length of the array
func SetArrayLength(int plength)
setLength(m_Elements, plength)
endfunc
; Copy
; <p>
; This performs a "deep" copy, where each element Array
; is fully copied to the target ArrayArray object. For
; large arrays, this will not be fast.
;
; @param dest ArrayArray object to copy all values into; previous contents of dest will be discarded.
func Copy(ArrayArray &dest)
int l = this.GetArrayLength()
if (dest == 0)
dest = new ArrayArray(l)
else
dest.SetArrayLength(l)
endif
int j = 0
while (j < l)
if (BooleanArray(m_Elements[j]))
BooleanArray ba = BooleanArray(dest.m_Elements[j])
if (!ba)
dest.m_Elements[j] = 0
endif
BooleanArray(m_Elements[j]).Copy(ba)
dest.m_Elements[j] = ba
elseif (IntegerArray(m_Elements[j]))
IntegerArray ia = IntegerArray(dest.m_Elements[j])
if (!ia)
dest.m_Elements[j] = 0
endif
IntegerArray(m_Elements[j]).Copy(ia)
dest.m_Elements[j] = ia
elseif (FloatArray(m_Elements[j]))
FloatArray fa = FloatArray(dest.m_Elements[j])
if (!fa)
dest.m_Elements[j] = 0
endif
FloatArray(m_Elements[j]).Copy(fa)
dest.m_Elements[j] = fa
elseif (ComplexArray(m_Elements[j]))
ComplexArray ca = ComplexArray(dest.m_Elements[j])
if (!ca)
dest.m_Elements[j] = 0
endif
ComplexArray(m_Elements[j]).Copy(ca)
dest.m_Elements[j] = ca
elseif (ColorArray(m_Elements[j]))
ColorArray pa = ColorArray(dest.m_Elements[j])
if (!pa)
dest.m_Elements[j] = 0
endif
ColorArray(m_Elements[j]).Copy(pa)
dest.m_Elements[j] = pa
elseif (VectorArray(m_Elements[j]))
VectorArray va = VectorArray(dest.m_Elements[j])
if (!va)
dest.m_Elements[j] = 0
endif
VectorArray(m_Elements[j]).Copy(va)
dest.m_Elements[j] = va
elseif (ArrayArray(m_Elements[j]))
ArrayArray aa = ArrayArray(dest.m_Elements[j])
if (!aa)
dest.m_Elements[j] = 0
endif
ArrayArray(m_Elements[j]).Copy(aa)
dest.m_Elements[j] = aa
elseif (GenericArray(m_Elements[j]))
GenericArray ga = GenericArray(dest.m_Elements[j])
if (!ga)
dest.m_Elements[j] = 0
endif
GenericArray(m_Elements[j]).Copy(ga)
dest.m_Elements[j] = ga
else
dest.m_Elements[j] = m_Elements[j]
endif
j = j + 1
endwhile
endfunc
; Array elements (for direct access)
Array m_Elements[]
default:
}
| Constructor Summary | |
|---|---|
ArrayArray()
|
|
ArrayArray(int plength)
Constructor |
|
| Method Summary | |
|---|---|
void |
Copy(ArrayArray dest)
Copy |
int |
GetArrayLength()
Length wrapper |
void |
SetArrayLength(int plength)
setLength wrapper |
| Methods inherited from class Object |
|---|
|
| Constructor Detail |
|---|
public ArrayArray(int plength)
plength - initial length of the arraypublic ArrayArray()
| Method Detail |
|---|
public int GetArrayLength()
GetArrayLength in class Arraypublic void SetArrayLength(int plength)
This is analagous to UF's native setLength() function for dynamic arrays.
SetArrayLength in class Arrayplength - new length of the arraypublic void Copy(ArrayArray dest)
This performs a "deep" copy, where each element Array is fully copied to the target ArrayArray object. For large arrays, this will not be fast.
dest - ArrayArray object to copy all values into; previous contents of dest will be discarded.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||