//
//  EXPConnectorElement.m
//  XMLTest
//
//  Created by Ashley on 16/04/2007.
//  Copyright 2007 __MyCompanyName__. All rights reserved.
//

#import "EXPConnectorElement.h"


@implementation EXPConnectorElement

- (id) init
{
	self = [super init];
	
	_input = nil;
	_output = nil;

	return self;
}

- (void) setElementFromXLMElement:(NSXMLElement *)element
{
	[super setElementFromXLMElement:element];

	NSArray *starts = [element elementsForName:@"start"];
	NSXMLElement *input = [starts objectAtIndex:0];
	NSString *inputName = [[input stringValue] stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]];
	[self setInput:inputName];
			
	NSArray *stops = [element elementsForName:@"stop"];
	NSXMLElement *output = [stops objectAtIndex:0];
	NSString *outputName = [[output stringValue] stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]];
	[self setOutput:outputName];
		
}

- (id) input
{
	return _input;
}

- (void) setInput:(id)input
{
	[input retain];
	[_input release];
	_input = input;
}

- (id) output
{
	return _output;
}

- (void) setOutput:(id)output
{
	[output retain];
	[_output release];
	_output = output;
}

- (NSString *)elementType
{
	return @"connector";
}

- (void) dealloc
{
	[_input release];
	[_output release];
	[super dealloc];
}

@end
