1 34 35 package com.hp.hpl.jena.util.iterator; 36 import java.util.Iterator ; 37 48 abstract public class LateBindingIterator implements Iterator { 49 50 private Iterator it; 51 52 58 public LateBindingIterator() { 59 } 60 61 public boolean hasNext() { 62 lazy(); 63 return it.hasNext(); 64 } 65 66 public Object next() { 67 lazy(); 68 return it.next(); 69 } 70 71 public void remove() { 72 lazy(); 73 it.remove(); 74 } 75 76 private void lazy() { 77 if ( it == null ) 78 it = create(); 79 } 80 88 public abstract Iterator create(); 89 90 } 91 | Popular Tags |