

#import "CommonHelpers.h"


@implementation NSObject (CollectionsHelpers)

- (id)freeze
{
    return [[self copy] autorelease];
}

@end

@implementation NSArray (CollectionsHelpers)

- (id)objectForValue:(id)val
{
    return val;
}

@end

@implementation NSMutableArray (CollectionsHelpers)

- (void)setObject:(id)item forValue:(id)val
{
    [self addObject:item];
}

@end

@implementation NSSet (CollectionsHelpers)

- (id)objectForValue:(id)val
{
    return val;
}

@end

@implementation NSMutableSet (CollectionsHelpers)

- (void)setObject:(id)item forValue:(id)val
{
    [self addObject:item];
}

@end

@implementation NSDictionary (CollectionsHelpers)

- (id)objectForValue:(id)val
{
    return [self objectForKey:val];
}

@end

@implementation NSMutableDictionary (CollectionsHelpers)

- (void)setObject:(id)item forValue:(id)val
{
    [self setObject:item forKey:val];
}

@end
