/** implement the abstract method close() from super class Iterator to finish cleaning up */ public void close() { if (!closeFlag) { scan.closescan(); closeFlag = true; } }