code: @Override
  	public boolean next(final T target) throws IOException, InterruptedException {
  		if (this.endOfStream) {
  			return false;
  			
  		}
  		while (true) {
  			InputChannelResult result = this.inputGate.readRecord(target);
  			switch (result) {
  				case INTERMEDIATE_RECORD_FROM_BUFFER:
  				case LAST_RECORD_FROM_BUFFER:
  					return true;
  					
  				case END_OF_SUPERSTEP:
  					if (incrementEndOfSuperstepEventAndCheck()) {
  						return false; // end of the superstep
  					}
  					else {
  						break; // fall through and wait for next record/event
  					}
  					
  				case TASK_EVENT:
  					handleEvent(this.inputGate.getCurrentEvent());
  					break;	// fall through to get next record
  				
  				case END_OF_STREAM:
  					this.endOfStream = true;
  					return false;
  					
  				default:
  					; // fall through to get next record
  			}
  		}
  	}
docs: --------------------------------------------------------------------------------------------