package Chain;

@ISA = qw(chemistry);

sub new {
	my $class = shift;
	$self = { 
		id => "",  
		residues => {}, 
		atoms => [], 
		totCharge => 0.0, 
		NTerm => 0
		};	
	bless $self;
}

sub id {
	my ($self, $id) = @_;
	$self->{id} = $id if defined $id;
	return $self->{id};
}

sub totCharge {
	my ($self, $charge) = @_;
	$self->{totCharge} = $charge if defined $charge;
	return $self->{totCharge};
}

sub getCharge {
	my $self = shift;
	$self->{totCharge} = 0.0;
	for my $r (@{$self->{atoms}}) {
		$self->{totCharge} += $r->charge;
	};
	return $self->{totCharge};
}



"1";
