• Home
  • Raw
  • Download

Lines Matching refs:BaseTree

27 #import "BaseTree.h"
42 @implementation BaseTree implementation
44 static id<BaseTree> invalidNode = nil;
48 + (id<BaseTree>) INVALID_NODE
56 + (id<BaseTree>) invalidNode
66 return [[BaseTree alloc] init];
69 /** Create a new node from an existing node does nothing for BaseTree
73 + newTree:(id<BaseTree>) node
75 return [[BaseTree alloc] initWith:(id<BaseTree>) node];
88 - (id) initWith:(id<BaseTree>)node
103 NSLog( @"called dealloc in BaseTree %x", (NSInteger)self );
107 NSLog( @"called dealloc children in BaseTree" );
114 - (id<BaseTree>) getChild:(NSUInteger)i
119 return (id<BaseTree>)[children objectAtIndex:i];
139 - (id<BaseTree>) getFirstChildWithType:(NSInteger) aType
142 id<BaseTree> t = (id<BaseTree>) [children objectAtIndex:i];
164 - (void) addChild:(id<BaseTree>) t
171 if ( self == (BaseTree *)t )
172 …@throw [IllegalArgumentException newException:@"BaseTree Can't add self to self as child"];
173 id<BaseTree> childTree = (id<BaseTree>) t;
176 @throw [RuntimeException newException:@"BaseTree add child list to itself"];
183 id<BaseTree> c = (id<BaseTree>)[childTree.children objectAtIndex:i];
186 [c setParent:(id<BaseTree>)self];
203 [childTree setParent:(id<BaseTree>)self];
213 id<BaseTree> t = (id<BaseTree>) [kids objectAtIndex:i];
218 - (void) setChild:(NSUInteger) i With:(id<BaseTree>)t
224 …@throw [IllegalArgumentException newException:@"BaseTree Can't set single child to a list"]; …
235 [t setParent:(id<BaseTree>)self];
244 id<BaseTree> killed = (id<BaseTree>)[children objectAtIndex:idx];
260 " with "+((BaseTree)t).toStringTree());
264 …@throw [IllegalArgumentException newException:@"BaseTree Invalid Indexes; no children in list"]; …
268 id<BaseTree> newTree = (id<BaseTree>) t;
285 id<BaseTree> child = (id<BaseTree>)[newChildren objectAtIndex:j];
287 [child setParent:(id<BaseTree>)self];
339 id<BaseTree> child = (id<BaseTree>)[self getChild:i];
341 [child setParent:(id<BaseTree>)self];
350 - (void) sanityCheckParentAndChildIndexes:(id<BaseTree>)aParent At:(NSInteger) i
360 id<BaseTree> child = (id<BaseTree>)[self getChild:c];
361 [child sanityCheckParentAndChildIndexes:(id<BaseTree>)self At:c];
389 - (id<BaseTree>) dupNode
395 /** BaseTree doesn't track child indexes. */
405 /** BaseTree doesn't track parent pointers. */
406 - (id<BaseTree>) getParent
411 - (void) setParent:(id<BaseTree>) t
422 - (id<BaseTree>) getAncestor:(NSInteger) ttype
424 id<BaseTree> t = (id<BaseTree>)self;
425 t = (id<BaseTree>)[t getParent];
429 t = (id<BaseTree>)[t getParent];
442 id<BaseTree> t = (id<BaseTree>)self;
443 t = (id<BaseTree>)[t getParent];
446 t = (id<BaseTree>)[t getParent];
480 id<BaseTree> theCopy = [[[self class] allocWithZone:aZone] init];
492 id<BaseTree> theCopy = [self copyWithZone:aZone];
498 id<BaseTree> childCopy = [loopItem deepCopyWithZone:aZone];
517 id<BaseTree> t = (id<BaseTree>)[children objectAtIndex:i];
521 [buf appendString:[(id<BaseTree>)t toStringTree]];