2 // NJInputPathElement.m
5 // Created by Joe Wreschnig on 3/13/13.
9 #include "NJInputPathElement.h"
11 @implementation NJInputPathElement {
15 - (id)initWithName:(NSString *)name
17 parent:(NJInputPathElement *)parent {
18 if ((self = [super init])) {
26 - (BOOL)isEqual:(id)object {
27 return [object isKindOfClass:NJInputPathElement.class]
28 && [[object uid] isEqualToString:self.uid];
36 return [NSString stringWithFormat:@"%@~%@", _parent.uid, _eid];
39 - (NJInputPathElement *)elementForUID:(NSString *)uid {
40 if ([uid isEqualToString:self.uid])
42 else if (![uid hasPrefix:self.uid])
45 for (NJInputPathElement *elem in self.children) {
46 NJInputPathElement *ret = [elem elementForUID:uid];