1 16 package javax.faces.component; 17 18 import java.util.Iterator ; 19 import java.util.List ; 20 import java.util.Map ; 21 import java.util.NoSuchElementException ; 22 23 27 class _FacetsAndChildrenIterator 28 implements Iterator 29 { 30 private Iterator _facetsIterator; 31 private Iterator _childrenIterator; 32 33 _FacetsAndChildrenIterator(Map facetMap, List childrenList) 34 { 35 _facetsIterator = facetMap != null ? facetMap.values().iterator() : null; 36 _childrenIterator = childrenList != null ? childrenList.iterator() : null; 37 } 38 39 public boolean hasNext() 40 { 41 return (_facetsIterator != null && _facetsIterator.hasNext()) || 42 (_childrenIterator != null && _childrenIterator.hasNext()); 43 } 44 45 public Object next() 46 { 47 if (_facetsIterator != null && _facetsIterator.hasNext()) 48 { 49 return _facetsIterator.next(); 50 } 51 else if (_childrenIterator != null && _childrenIterator.hasNext()) 52 { 53 return _childrenIterator.next(); 54 } 55 else 56 { 57 throw new NoSuchElementException (); 58 } 59 } 60 61 public void remove() 62 { 63 throw new UnsupportedOperationException (this.getClass().getName() + " UnsupportedOperationException"); 64 } 65 66 } 67 | Popular Tags |