Class UResourceBundleIterator


  • public class UResourceBundleIterator
    extends Object

    Class for enabling iteration over UResourceBundle objects. Example of use:

     ICUResourceBundleIterator iterator = resB.getIterator();
     ICUResourceBundle temp;
     while (iterator.hasNext()) {
        temp = iterartor.next();  
        int type = temp.getType();
        switch(type){
          case UResourceBundle.STRING:
              str = temp.getString();
              break;
          case UResourceBundle.INT:
              integer = temp.getInt();
              break;
         .....
        }
       // do something interesting with data collected
     }
     
    Author:
    ram
    • Constructor Detail

      • UResourceBundleIterator

        public UResourceBundleIterator​(UResourceBundle bndl)
        Construct a resource bundle iterator for the given resource bundle
        Parameters:
        bndl - The resource bundle to iterate over
    • Method Detail

      • reset

        public void reset()
        Resets the internal context of a resource so that iteration starts from the first element.
      • hasNext

        public boolean hasNext()
        Checks whether the given resource has another element to iterate over.
        Returns:
        TRUE if there are more elements, FALSE if there is no more elements