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

#ifndef _ITERATORCOMPRISING_M_
#define _ITERATORCOMPRISING_M_

- (BOOL)getNextElement:(elt*)anElePtr withEnumState:(void**)enumState
{
  BOOL result=NO;
  if (anElePtr->id_u)
    {
     anElePtr->id_u=[anElePtr->id_u nextLink];
    }
  else
    anElePtr->id_u=self;
  if (anElePtr->id_u) result=YES;
  return result;
  
}

- (BOOL)getPrevElement:(elt*)anElePtr withEnumState:(void**)enumState;
{
  BOOL result=NO;
  if (anElePtr->id_u)
    {
      anElePtr->id_u=[anElePtr->id_u prevLink];
    }
  else
    {
      for(anElePtr->id_u=self; 
	  [anElePtr->id_u nextLink];
	  anElePtr->id_u=[anElePtr->id_u nextLink]);
    }
  if (anElePtr->id_u) result=YES;
  return result;
}


#endif

