// ////////////////////////////////////////////////////////
// Copyright (1994) Columbia University
// Department of Biochemistry and Molecular Biophysics
//
// Author: Weider Chang, Ph.D
// ///////////////////////////////////////////////////////

#include "itemasso.h"

@implementation WDCItemAssocValue

#include "llistcom.m"
#include "itering.m"

- free
{
  [_item free];
  [_value free];
}

- getItem;
{
  return _item;
}

- getValue;
{
  return _value;
}

- deepCopy
{
  id temp=[WDCItemAssocValue alloc];
  [temp setItem:[[self getItem] deepCopy]];
  [temp setValue:[[self getValue] deepCopy]];
  return [temp setNextLink:[[self nextLink] deepCopy]];
}

- shallowCopy
{
  id temp=[WDCItemAssocValue alloc];
  [temp setItem:[self getItem]];
  [temp setValue:[self getValue]];
  return temp;
}
  
- setItem: item;
{
  _item=item;
  return self;
}

- setValue: value;
{
  _value=value;
  return self;
}

- (int)compare:anObject
{
  if (![anObject isKindOf:[self class]])
    [self error:"Can't compare with a non-ItemAssoc object."];
  return ([_item compare: [anObject getItem]] ||
	  [_value compare: [anObject getValue]]);
}

- printForDebuggerAux
{
  id temp;
  printf(" _item:");
  [_item printForDebugger];
  printf("\n");
  printf(" _value:");
  [_value printForDebugger];
  
};

- printForDebugger
{
  printf("(%s\n", [self name]);
  [self printForDebuggerAux];
  printf(")\n");
  if (_next) [_next printForDebugger];
  return self;
}
  

@end




