public ProfileLocatorProperty [] next() { ProfileLocatorProperty [] properties = null; if (last >= 0) { // generate properties list to return List elements = locator.getElements(); properties = new ProfileLocatorProperty[last+1]; ProfileLocatorProperty lastElement = null; Iterator it = elements.listIterator(); for (int count = 0; (count <= last) && it.hasNext(); count++) { lastElement = (ProfileLocatorProperty)it.next(); properties[count] = lastElement; } // modify iterator state based on fallback type; // performed here to prevent multiple calls to // hasNext() from changing iterator state state = lastElement.getFallbackType(); last--; } return properties; } }