/** Returns the group results. */ Iterator<GroupItem> groupResults() { if (_groupMap == null) return com.caucho.util.NullIterator.create(); Iterator<GroupItem> results = _groupMap.values().iterator(); _groupMap = null; return results; }
public static Iterator getIterator(Object items) throws JspTagException { if (items == null) return NullIterator.create(); else if (items instanceof Map) return ((Map) items).entrySet().iterator(); else if (items instanceof Collection) return ((Collection) items).iterator(); else if (items.getClass().isArray()) return new ArrayIterator(items); else if (items instanceof Iterator) return (Iterator) items; else if (items instanceof Enumeration) return new EnumIterator((Enumeration) items); else if (items instanceof String) return new StringIterator((String) items); else throw new JspTagException(L.l("unknown items value `{0}'", items)); }