?? emptyiterator.java
字號:
package com.wrox.algorithms.iteration;/** * An {@link Iterator} where {@link #isDone()} always returns <code>true</code>. * */public final class EmptyIterator implements Iterator { /** The single, publicly accessible, instance of the comparator. */ public static final EmptyIterator INSTANCE = new EmptyIterator(); /** * Constructor marked private to prevent instantiation. */ private EmptyIterator() { // Nothing to do } public void first() { // Nothing to do } public void last() { // Nothing to do } public boolean isDone() { // We're always done! return true; } public void next() { // Nothing to do } public void previous() { // Nothing to do } public Object current() throws IteratorOutOfBoundsException { throw new IteratorOutOfBoundsException(); }}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -