/** * To get the next block * @return next data block * */ @Override public DataRefNode next() { // get the current blocks DataRefNode datablockTemp = datablock; // store the next data block datablock = datablock.getNextDataRefNode(); // increment the counter blockCounter++; // if all the data block is processed then // set the has next flag to false // or if number of blocks assigned to this iterator is processed // then also set the hasnext flag to false if (null == datablock || blockCounter >= this.totalNumberOfBlocksToScan) { hasNext = false; } return datablockTemp; } }