static ListIterator<XSObject> listIteratorFromXSObjectList(XSObjectList list) { ArrayList<XSObject> objects = new ArrayList<XSObject>(list.getLength()); for (int i = 0; i < list.getLength(); i++) { if (list.item(i) != null) { objects.add(list.item(i)); } } return objects.listIterator(); }
@Override public int length() { return list.getLength(); }
@Override @SuppressWarnings({"unchecked"}) protected E findNext() { return (E) list.item(++i); }