1996-04-17 18:46:15 +00:00
|
|
|
#include <gnustep/base/all.h>
|
1994-11-04 16:29:24 +00:00
|
|
|
|
|
|
|
int main()
|
|
|
|
{
|
1996-04-01 02:42:06 +00:00
|
|
|
id dict = [Dictionary new];
|
|
|
|
|
|
|
|
id translator = [Dictionary new];
|
1994-11-04 16:29:24 +00:00
|
|
|
id mc;
|
|
|
|
|
1996-04-01 02:42:06 +00:00
|
|
|
[dict putObject:@"herd" atKey:@"cow"];
|
|
|
|
[dict putObject:@"pack" atKey:@"dog"];
|
|
|
|
[dict putObject:@"school" atKey:@"fish"];
|
|
|
|
[dict putObject:@"flock" atKey:@"bird"];
|
|
|
|
[dict putObject:@"pride" atKey:@"cat"];
|
|
|
|
[dict putObject:@"gaggle" atKey:@"goose"];
|
1994-11-04 16:29:24 +00:00
|
|
|
[dict printForDebugger];
|
|
|
|
printf("removing goose\n");
|
1996-04-01 02:42:06 +00:00
|
|
|
[dict removeObjectAtKey:@"goose"];
|
1994-11-04 16:29:24 +00:00
|
|
|
[dict printForDebugger];
|
|
|
|
|
1996-04-01 02:42:06 +00:00
|
|
|
[translator putObject:@"cow" atKey:@"vache"];
|
|
|
|
[translator putObject:@"dog" atKey:@"chien"];
|
|
|
|
[translator putObject:@"fish" atKey:@"poisson"];
|
|
|
|
[translator putObject:@"bird" atKey:@"oisseau"];
|
|
|
|
[translator putObject:@"cat" atKey:@"chat"];
|
1994-11-04 16:29:24 +00:00
|
|
|
|
1996-04-01 02:42:06 +00:00
|
|
|
mc = [[MappedCollector alloc] initWithCollection:dict map:translator];
|
1994-11-04 16:29:24 +00:00
|
|
|
[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);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|