1994-11-04 16:29:24 +00:00
|
|
|
|
|
|
|
#include <objects/objects.h>
|
|
|
|
|
|
|
|
|
|
|
|
int main()
|
|
|
|
{
|
|
|
|
id dict = [[Dictionary alloc] initWithType:"*"
|
|
|
|
keyType:"*"];
|
|
|
|
id translator = [[Dictionary alloc] initWithType:"*"
|
|
|
|
keyType:"*"];
|
|
|
|
id mc;
|
|
|
|
|
|
|
|
[dict putElement:"herd" atKey:"cow"];
|
|
|
|
[dict putElement:"pack" atKey:"dog"];
|
|
|
|
[dict putElement:"school" atKey:"fish"];
|
|
|
|
[dict putElement:"flock" atKey:"bird"];
|
|
|
|
[dict putElement:"pride" atKey:"cat"];
|
|
|
|
[dict putElement:"gaggle" atKey:"goose"];
|
|
|
|
[dict printForDebugger];
|
|
|
|
printf("removing goose\n");
|
|
|
|
[dict removeElementAtKey:"goose"];
|
|
|
|
[dict printForDebugger];
|
|
|
|
|
|
|
|
[translator putElement:"cow" atKey:"vache"];
|
|
|
|
[translator putElement:"dog" atKey:"chien"];
|
|
|
|
[translator putElement:"fish" atKey:"poisson"];
|
|
|
|
[translator putElement:"bird" atKey:"oisseau"];
|
|
|
|
[translator putElement:"cat" atKey:"chat"];
|
|
|
|
|
|
|
|
mc = [[MappedCollector alloc] initCollection:dict map:translator];
|
|
|
|
[mc printForDebugger];
|
|
|
|
|
1995-03-12 19:33:56 +00:00
|
|
|
[mc release];
|
|
|
|
[dict release];
|
|
|
|
[translator release];
|
1994-11-04 16:29:24 +00:00
|
|
|
|
|
|
|
exit(0);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|