Exemplo n.º 1
0
            protected internal override String[] HandleGetStringArray()
            {
                String[] strings             = new String[size];
                UResourceBundleIterator iter = GetIterator();
                int i = 0;

                while (iter.HasNext())
                {
                    strings[i++] = iter.Next().GetString();
                }
                return(strings);
            }
Exemplo n.º 2
0
        private void LoadDates()
        {
            CalendarData    calData = new CalendarData(fLocale, calendar.GetType());
            UResourceBundle rb      = calData.Get("fields", "day", "relative");

            ILOG.J2CsMapping.Collections.ISet datesSet = new SortedSet(new RelativeDateFormat.Anonymous_C0());

            for (UResourceBundleIterator i = rb.GetIterator(); i.HasNext();)
            {
                UResourceBundle line = i.Next();

                String k = line.GetKey();
                String v = line.GetString();
                RelativeDateFormat.URelativeString rs = new RelativeDateFormat.URelativeString(k, v);
                ILOG.J2CsMapping.Collections.Generics.Collections.Add(datesSet, rs);
            }
            fDates = new RelativeDateFormat.URelativeString [0];
            fDates = (RelativeDateFormat.URelativeString [])ILOG.J2CsMapping.Collections.Generics.Collections.ToArray(datesSet, fDates);
        }
Exemplo n.º 3
0
            public virtual bool HasNext()
            {
                if (isStrRes)
                {
                    return(HasNextForStrRes());
                }

                if (preparedNextElement != null)
                {
                    return(true);
                }
                UResourceBundle t = null;

                if (itr.HasNext())
                {
                    // Notice, other RuntimeException may be throwed
                    t = itr.Next();
                }
                else
                {
                    return(false);
                }

                try {
                    preparedNextElement = PrepareNext(t);
                    IBM.ICU.Charset.ResourceModule.Assert_not(preparedNextElement == null,
                                                              "prepareNext() should not return null");
                    return(true);
                } catch (TestDataModule_Constants.DataModuleFormatError e) {
                    // Sadly, we throw RuntimeException also
                    // #if defined(FOUNDATION10) || defined(J2SE13)
                    // ## throw new RuntimeException(e.getMessage());
                    // #else
                    throw new Exception(e.Message, e);
                    // #endif
                }
            }