com.ibm.icu.util
public class UResourceBundleIterator extends java.lang.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 }
Constructor and Description |
---|
UResourceBundleIterator(UResourceBundle bndl)
Construct a resource bundle iterator for the
given resource bundle
|
Modifier and Type | Method and Description |
---|---|
boolean |
hasNext()
Checks whether the given resource has another element to iterate over.
|
UResourceBundle |
next()
Returns the next element of this iterator if this iterator object has at least one more element to provide
|
java.lang.String |
nextString()
Returns the next String of this iterator if this iterator object has at least one more element to provide
|
void |
reset()
Resets the internal context of a resource so that iteration starts from the first element.
|
public UResourceBundleIterator(UResourceBundle bndl)
bndl
- The resource bundle to iterate overpublic UResourceBundle next() throws java.util.NoSuchElementException
java.util.NoSuchElementException
public java.lang.String nextString() throws java.util.NoSuchElementException, UResourceTypeMismatchException
java.util.NoSuchElementException
UResourceTypeMismatchException
public void reset()
public boolean hasNext()
Copyright (c) 2009 IBM Corporation and others.