NullIterator.java :  » Game » easy-game-client » com » croftsoft » core » util » Java Open Source

Java Open Source » Game » easy game client 
easy game client » com » croftsoft » core » util » NullIterator.java
     package com.croftsoft.core.util;

     import java.util.*;

     /*********************************************************************
     * A singleton null object Iterator implementation.
     *
     * @version
     *   2003-05-12
     * @since
     *   2003-05-10
     * @author
     *   <a href="http://www.CroftSoft.com/">David Wallace Croft</a>
     *********************************************************************/

     public final class  NullIterator
       implements Iterator
     //////////////////////////////////////////////////////////////////////
     //////////////////////////////////////////////////////////////////////
     {

     public static final NullIterator  INSTANCE = new NullIterator ( );

     //////////////////////////////////////////////////////////////////////
     //////////////////////////////////////////////////////////////////////

     public boolean  hasNext ( ) { return false; }

     public Object  next ( ) { throw new NoSuchElementException ( ); }

     public void  remove ( ) {
       throw new UnsupportedOperationException ( ); }

     //////////////////////////////////////////////////////////////////////
     //////////////////////////////////////////////////////////////////////

     private  NullIterator ( ) { }

     //////////////////////////////////////////////////////////////////////
     //////////////////////////////////////////////////////////////////////
     }
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.