mirror of
https://github.com/thes3m/XNI
synced 2024-12-26 13:26:06 +01:00
47 lines
887 B
Objective-C
47 lines
887 B
Objective-C
//
|
|
// ReadOnlyCollection.m
|
|
// XNI
|
|
//
|
|
// Created by Matej Jan on 29.11.10.
|
|
// Copyright 2010 Retronator. All rights reserved.
|
|
//
|
|
|
|
// #define ReadOnlyCollection ReadOnlyCollectionName
|
|
// #define T DataType
|
|
|
|
@implementation ReadOnlyCollection
|
|
|
|
- (id) initWithItems:(NSArray*)items
|
|
{
|
|
self = [super init];
|
|
if (self != nil) {
|
|
collection = [[NSMutableArray alloc] initWithArray:items];
|
|
#ifdef Initialization
|
|
Initialization
|
|
#endif
|
|
}
|
|
return self;
|
|
}
|
|
|
|
- (int) count {
|
|
return [collection count];
|
|
}
|
|
|
|
- (T)itemAt:(int)index {
|
|
return [collection objectAtIndex:index];
|
|
}
|
|
|
|
- (NSUInteger) countByEnumeratingWithState:(NSFastEnumerationState *)state objects:(id *)stackbuf count:(NSUInteger)len {
|
|
return [collection countByEnumeratingWithState:state objects:stackbuf count:len];
|
|
}
|
|
|
|
- (void) dealloc
|
|
{
|
|
[collection release];
|
|
[super dealloc];
|
|
}
|
|
|
|
@end
|
|
|
|
// #undef ReadOnlyCollection
|
|
// #undef T |