//
//  TreeViewData.h
//  EAMNext
//
//  Created by Chris Snow on 12/11/17.
//

#import "WebQueryParameters.h"
#import "WebQuery.h"

@interface TreeViewData : NSObject {
    int index;
    NSString *value;
    TreeViewData *parent;
    NSMutableArray *children;
    BOOL inclusive;
    NSArray *flattenedTreeCache;
}

@property (nonatomic) int index;
@property (nonatomic, retain) NSString *value;
@property (nonatomic, retain) TreeViewData *parent;
@property (nonatomic, retain, readonly) NSMutableArray *children;
@property (nonatomic) BOOL inclusive;
@property NSString* groupName;
@property BOOL isSelected;


- (id)initWithValue:(NSString *)_value;

- (void)addChild:(TreeViewData *)newChild;
- (NSUInteger)descendantCount;
- (NSUInteger)levelDepth;
- (NSArray *)flattenElements;
- (NSArray *)flattenElementsWithCacheRefresh:(BOOL)invalidate;
- (BOOL)isRoot;
- (BOOL)hasChildren;

@end
