Skip to content
Snippets Groups Projects
ISROr.cpp 1.41 KiB
Newer Older
  • Learn to ignore specific revisions
  • //
    // Created by Jake Close on 3/13/18.
    //
    
    
    jsclose's avatar
    jsclose committed
    
    
    
    vcday's avatar
    vcday committed
    Location ISROr::GetStartLocation ( )
    
    jsclose's avatar
    jsclose committed
    	{
    	return nearestStartLocation;
    	}
    
    
    jsclose's avatar
    jsclose committed
    Location ISROr::GetCurrentLocation(){
    	return nearestStartLocation;
    	}
    
    
    jsclose's avatar
    jsclose committed
    
    
    vcday's avatar
    vcday committed
    Location ISROr::GetEndLocation ( )
    
    jsclose's avatar
    jsclose committed
    	{
    	return nearestEndLocation;
    	}
    
    
    
    Location ISROr::First()
    
    jsclose's avatar
    jsclose committed
    	{
    
    	//Fixme
    	Location x;
    	return x;
    
    jsclose's avatar
    jsclose committed
    	}
    
    vcday's avatar
    vcday committed
    
    
    jsclose's avatar
    jsclose committed
    /*
    Returns the location of the next document that is a match
    */
    
    jsclose's avatar
    jsclose committed
    Location ISROr::Next ( )
    
    jsclose's avatar
    jsclose committed
    	{
    
    vcday's avatar
    vcday committed
    	Location nearestEnd = this->nearestTerm->GetEndDocument( );
    
    jsclose's avatar
    jsclose committed
    
    
    jsclose's avatar
    jsclose committed
    	for(auto Term : Terms)
    
    jsclose's avatar
    jsclose committed
    		Location newSeekLocation = Term->Seek( nearestEnd + 1 );
    
    vcday's avatar
    vcday committed
    		if ( newSeekLocation < nearestStartLocation )
    
    jsclose's avatar
    jsclose committed
    			nearestStartLocation = newSeekLocation;
    
    jsclose's avatar
    jsclose committed
    			nearestTerm = Term;
    
    jsclose's avatar
    jsclose committed
    		}
    
    jsclose's avatar
    jsclose committed
    
    
    jsclose's avatar
    jsclose committed
    	return this->nearestTerm->currentLocation;
    
    jsclose's avatar
    jsclose committed
    
    
    jsclose's avatar
    jsclose committed
    
    
    Location ISROr::NextDocument()
    	{
    	//Fixme
    	Location x;
    	return x;
    
    jsclose's avatar
    jsclose committed
    	}
    
    
    jsclose's avatar
    jsclose committed
    
    
    Location ISROr::Seek ( Location target )
    	{
    
    	// Seek all the ISRs to the first occurrence beginning at// the target location. Return null if there is no match.
    	// The document is the document containing the nearest term.
    	//seek past target locations,
    	//seek all terms in or past starting location, take the ones that nears
    	//the document that the nearest term is in is the document ur in
    	//updates private members
    
    
    
    
    	return 1;
    
    	}
    
    
    Location ISROr::GetEndDocument()
    	{
    	//Fixme
    	Location x;
    	return x;
    	}
    
    
    jsclose's avatar
    jsclose committed
    /*
    ISR *ISROr::GetCurrentEndDoc ( )
    
    vcday's avatar
    vcday committed
    	{
    
    jsclose's avatar
    jsclose committed
    
    
    vcday's avatar
    vcday committed
    	return this->nearestTerm->GetDocumentISR( );
    
    jsclose's avatar
    jsclose committed
    
    	}
    
    jsclose's avatar
    jsclose committed
    */
    
    jsclose's avatar
    jsclose committed