空迭代器
// Copyright (c) 2006 - 2008, Clark & Parsia, LLC. <http://www.clarkparsia.com> //package com.nowjava;/** from nowjava.com - 时 代 Java**/ import java.util.Iterator; import java.util.NoSuchElementException; public class Main { private static final Iterator<Object> EMPTY_ITERATOR = new Iterator<Object>() { public boolean hasNext() { return false; } public Object next() { throw new NoSuchElementException(); } public void remove() { throw new UnsupportedOperationException(); } }; /**from N o w J a v a . c o m**/ @SuppressWarnings("unchecked")