1 |
bearsoft |
1.1 |
#include "../../String/String.h"
|
2 |
|
|
#include "../../String/StringInput.h"
|
3 |
|
|
#include "../../String/StringTools.h"
|
4 |
|
|
#include "../../String/Parse.h"
|
5 |
|
|
#include "../../System/System.h"
|
6 |
|
|
#include "../../Array/IntArray.h"
|
7 |
|
|
#include "../../Array/FloatArray.h"
|
8 |
|
|
#include "../../Array/StringArray.h"
|
9 |
|
|
#include "../../Array/ObjectArray.h"
|
10 |
|
|
#include "../../String/ExtPropertiesElement.h"
|
11 |
|
|
#include "ArrayTest5.h"
|
12 |
|
|
#include "../../System/SystemDefine.h"
|
13 |
|
|
|
14 |
|
|
|
15 |
|
|
ArrayTest5::ArrayTest5(){}
|
16 |
|
|
ArrayTest5::~ArrayTest5(){}
|
17 |
|
|
|
18 |
|
|
void ArrayTest5::run()
|
19 |
|
|
{
|
20 |
|
|
|
21 |
|
|
ObjectArray<ExtPropertiesElement> *objectArray=new ObjectArray<ExtPropertiesElement>(3);
|
22 |
|
|
|
23 |
|
|
objectArray->setObject(new ExtPropertiesElement("blaha1","kalle"),0);
|
24 |
|
|
objectArray->setObject(new ExtPropertiesElement("blaha2","kalle"),1);
|
25 |
|
|
objectArray->setObject(new ExtPropertiesElement("blaha3","kalle"),2);
|
26 |
|
|
|
27 |
|
|
|
28 |
|
|
String arrayInfo="ObjectValue: ";
|
29 |
|
|
String nameInfo="ObjectName: ";
|
30 |
|
|
|
31 |
|
|
for ( int r=0; r<objectArray->size ; r++ )
|
32 |
|
|
{
|
33 |
|
|
ExtPropertiesElement *extPropertiesElement=objectArray->getObject(r);
|
34 |
|
|
System::println(arrayInfo + "nonSorted " + extPropertiesElement->key->buffer);
|
35 |
|
|
System::println(nameInfo + " nonSorted " + objectArray->getObjectName(r));
|
36 |
|
|
}
|
37 |
|
|
|
38 |
|
|
objectArray->sortLargestOrder();
|
39 |
|
|
|
40 |
|
|
for ( int r2=0; r2<objectArray->size ; r2++ )
|
41 |
|
|
{
|
42 |
|
|
ExtPropertiesElement *extPropertiesElement=objectArray->getObject(r2);
|
43 |
|
|
System::println(arrayInfo + "Sorted " + extPropertiesElement->key->buffer);
|
44 |
|
|
System::println(nameInfo + " Sorted " + objectArray->getObjectName(r2));
|
45 |
|
|
}
|
46 |
|
|
|
47 |
|
|
|
48 |
|
|
delete objectArray;
|
49 |
|
|
|
50 |
|
|
} |