Programming with JViews Maps > Creating a Map Application Using the API > Writing a Data Source > Feature Management

The IlvMapReusableFeatureIterator is a sub-interface of IlvMapFeatureIterator. It adds to the base interface the capability to restart the iteration more than once. This is necessary when, for example, projection parameters have changed and the data source needs to render all the graphic objects again. This is also used for load-on-demand or save/reload mechanisms.

You can transform a feature iterator (such as for readers written for a previous version of JViews Maps) into a reusable feature iterator by using the IlvMapDelegateFeatureIterator abstract class. For example, the code below uses the feature iterator returned by an IlvMapLoader:

String fileName="some file name";
public IlvMapReusableFeatureIterator getFeatureIterator() {
   return new IlvMapDelegateFeatureIterator() {
      public void restart() {
         IlvMapLoader loader = new IlvMapLoader(null);
            try {
               setDelegate(loader.makeFeatureIterator(fileName));
            } catch (IOException e) {
               e.printStackTrace();
            }
        }
    };
}