#include <base/Application.h>
#include <base/collection/HashTable.h>
using namespace com::azure::dev::base;
private:
static const unsigned int MAJOR_VERSION = 1;
static const unsigned int MINOR_VERSION = 0;
public:
HashTableApplication()
{
}
void main()
{
fout << getFormalName() << " version "
<< MAJOR_VERSION << '.' << MINOR_VERSION << EOL
<< "The Base Framework (Test Suite)" << EOL
<< ENDL;
fout << "Initializing map" << ENDL;
fout << "Adding associations to map ((2,2), (4,3), and (3,4))" << ENDL;
fout << "mii: " << mii << ENDL;
fout <<
"size: " << mii.
getSize() << ENDL;
{
fout << "Modifying enumeration of values of map (multiply by 3)" << ENDL;
}
fout << "mii: " << mii << ENDL;
}
{
fout << "Non-modifying enumeration of map (calculate sum of values)" << ENDL;
int sum = 0;
}
fout << "sum: " << sum << ENDL;
}
fout << "Adding associations to map ((1,6), (2,5), (4,2), and (5,1))" << ENDL;
fout << "mii: " << mii << ENDL;
fout << "Removing associations from map (4 and 3)" << ENDL;
fout << "mii: " << mii << ENDL;
fout <<
"Size: " << mii.
getSize() << ENDL;
fout << "Removing all associations from the map" << ENDL;
fout <<
"Size: " << mii.
getSize() << ENDL;
MESSAGE("hi"),
MESSAGE("hello"),
MESSAGE("world"),
MESSAGE("the"),
MESSAGE("base"),
MESSAGE("framework"),
MESSAGE("word"),
MESSAGE("this"),
MESSAGE("keyword"),
MESSAGE("here"),
MESSAGE("other"),
MESSAGE("other2"),
MESSAGE("other3"),
MESSAGE("otsdfgher"),
MESSAGE("ofdgther2"),
MESSAGE("othergf3343"),
MESSAGE("othdfer"),
MESSAGE("otdher2"),
MESSAGE("otherd3"),
MESSAGE("otce2her"),
MESSAGE("othdF"),
MESSAGE("o23th"),
MESSAGE("a"),
MESSAGE("b"),
MESSAGE("c"),
MESSAGE("0")
};
for (unsigned int i = 0; i < getArraySize(WORDS); ++i) {
hashTable.
add(WORDS[i], WORDS[i].getLength());
}
fout << hashTable << ENDL;
}
};
APPLICATION_STUB(HashTableApplication);