1 18 package org.objectweb.jorm.lib; 19 20 import org.objectweb.jorm.api.PNameIterator; 21 import org.objectweb.jorm.api.PException; 22 23 import java.util.NoSuchElementException ; 24 25 29 public class EmptyPNameIterator implements PNameIterator { 30 31 private static PNameIterator instance; 32 33 public static synchronized PNameIterator getInstance() { 34 if (instance == null) { 35 instance = new EmptyPNameIterator(); 36 } 37 return instance; 38 } 39 40 private EmptyPNameIterator() { 41 } 42 43 public void close() throws PException { 44 } 45 46 public boolean hasNext() { 47 return false; 48 } 49 50 public Object next() { 51 throw new NoSuchElementException (); 52 } 53 54 public void remove() { 55 throw new UnsupportedOperationException ("Remove operation not supported"); 56 } 57 } 58 | Popular Tags |