001 package railo.runtime.com; 002 003 import java.util.Iterator; 004 005 import com.jacob.com.EnumVariant; 006 007 /** 008 * 009 */ 010 public final class COMValueWrapperIterator implements Iterator { 011 012 private EnumVariant enumVariant; 013 private COMObject wrapper; 014 015 /** 016 * @param wrapper 017 */ 018 public COMValueWrapperIterator(COMObject wrapper) { 019 this.enumVariant=new EnumVariant(wrapper.getDispatch()); 020 this.wrapper=wrapper; 021 } 022 023 /** 024 * @see java.util.Iterator#remove() 025 */ 026 public void remove() { 027 enumVariant.safeRelease(); 028 } 029 030 /** 031 * @see java.util.Iterator#hasNext() 032 */ 033 public boolean hasNext() { 034 return enumVariant.hasMoreElements(); 035 } 036 037 /** 038 * @see java.util.Iterator#next() 039 */ 040 public Object next() { 041 return COMUtil.toObject(wrapper,enumVariant.Next(),"",null); 042 } 043 }