Top Description Fields Constructors Methods
com.ibm.icu.util

public Class UResourceBundleIterator

extends Object
Class Inheritance
Imports
java.util.NoSuchElementException

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

ICUResourceBundleIterator iterator = resB.getIterator();
ICUResourceBundle temp;
while (iterator.hasNext()) {
   temp = iterator.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
ICU Status
Stable since ICU 3.8.

Field Summary

Modifier and TypeField and Description
private UResourceBundle
private int
private int

Constructor Summary

AccessConstructor and Description
public
UResourceBundleIterator(UResourceBundle
The resource bundle to iterate over
bndl
)

Construct a resource bundle iterator for the given resource bundle

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

true if there are more elements, false if there is no more elements
hasNext
()

Checks whether the given resource has another element to iterate over.

public UResourceBundle

Returns:

the UResourceBundle object
next
()

Returns the next element of this iterator if this iterator object has at least one more element to provide

public String

Returns:

the UResourceBundle object
nextString
()

Returns the next String of this iterator if this iterator object has at least one more element to provide

public void
reset()

Resets the internal context of a resource so that iteration starts from the first element.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

bundleback to summary
private UResourceBundle bundle
indexback to summary
private int index
sizeback to summary
private int size

Constructor Detail

UResourceBundleIteratorback to summary
public UResourceBundleIterator(UResourceBundle bndl)

Construct a resource bundle iterator for the given resource bundle

Parameters
bndl:UResourceBundle

The resource bundle to iterate over

ICU Status
Stable since ICU 3.8.

Method Detail

hasNextback to summary
public boolean hasNext()

Checks whether the given resource has another element to iterate over.

Returns:boolean

true if there are more elements, false if there is no more elements

ICU Status
Stable since ICU 3.8.
nextback to summary
public UResourceBundle next() throws NoSuchElementException

Returns the next element of this iterator if this iterator object has at least one more element to provide

Returns:UResourceBundle

the UResourceBundle object

Exceptions
NoSuchElementException:
If there does not exist such an element.
ICU Status
Stable since ICU 3.8.
nextStringback to summary
public String nextString() throws NoSuchElementException, UResourceTypeMismatchException

Returns the next String of this iterator if this iterator object has at least one more element to provide

Returns:String

the UResourceBundle object

Exceptions
NoSuchElementException:
If there does not exist such an element.
UResourceTypeMismatchException:
If resource has a type mismatch.
ICU Status
Stable since ICU 3.8.
resetback to summary
public void reset()

Resets the internal context of a resource so that iteration starts from the first element.

ICU Status
Stable since ICU 3.8.