📄 niliterator.java
字号:
package org.codehaus.classloader;
import java.util.Iterator;
import java.util.NoSuchElementException;
/**
* This is an empty implementation of Iterator.
* <p>
* @author Ben Yu
* Aug 4, 2006 12:19:53 PM
*/
public final class NilIterator implements Iterator {
private NilIterator(){}
private static NilIterator singleton = new NilIterator();
/**
* Get an instance of this implementation.
*/
public static Iterator instance(){
return singleton;
}
public boolean hasNext() {
return false;
}
public Object next() {
throw new NoSuchElementException();
}
public void remove() {
throw new UnsupportedOperationException();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -