All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.ibm.icu.util.UResourceBundleIterator Maven / Gradle / Ivy

There is a newer version: 2.12.15
Show newest version
// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html#License
/*
******************************************************************************
* Copyright (C) 2004-2009, International Business Machines Corporation and   *
* others. All Rights Reserved.                                               *
******************************************************************************
*/

package com.ibm.icu.util;

import java.util.NoSuchElementException;

/**
 * 

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 * @stable ICU 3.8 */ public class UResourceBundleIterator{ private UResourceBundle bundle; private int index = 0; private int size = 0; /** * Construct a resource bundle iterator for the * given resource bundle * * @param bndl The resource bundle to iterate over * @stable ICU 3.8 */ public UResourceBundleIterator(UResourceBundle bndl){ bundle = bndl; size = bundle.getSize(); } /** * Returns the next element of this iterator if this iterator object has at least one more element to provide * @return the UResourceBundle object * @throws NoSuchElementException If there does not exist such an element. * @stable ICU 3.8 */ public UResourceBundle next()throws NoSuchElementException{ if(index




© 2015 - 2024 Weber Informatics LLC | Privacy Policy