0d5db8919f4fc39e5bfcc05badc4198154b4cc7c
[enjoyable.git] / Classes / NJMapping.h
1 //
2 // NJMapping.h
3 // Enjoy
4 //
5 // Created by Sam McCall on 4/05/09.
6 // Copyright 2009 University of Otago. All rights reserved.
7 //
8
9 @class NJOutput;
10 @class NJInput;
11
12 @interface NJMapping : NSObject
13
14 @property (nonatomic, copy) NSString *name;
15 @property (nonatomic, readonly) NSUInteger count;
16
17 + (id)mappingWithContentsOfURL:(NSURL *)url
18 mappings:(id <NSFastEnumeration>)mappings
19 error:(NSError **)error;
20
21 - (id)initWithName:(NSString *)name;
22 - (id)initWithSerialization:(NSDictionary *)serialization
23 mappings:(id <NSFastEnumeration>)mappings;
24
25 - (NJOutput *)objectForKeyedSubscript:(NJInput *)input;
26 - (void)setObject:(NJOutput *)output forKeyedSubscript:(NJInput *)input;
27 - (NSDictionary *)serialize;
28 - (BOOL)writeToURL:(NSURL *)url error:(NSError **)error;
29 - (BOOL)hasConflictWith:(NJMapping *)other;
30 - (void)mergeEntriesFrom:(NJMapping *)other;
31
32 @end