Esempio n. 1
0
            public int Compare(Object o1, Object o2)
            {
                RelativeDateFormat.URelativeString r1 = (RelativeDateFormat.URelativeString)o1;
                RelativeDateFormat.URelativeString r2 = (RelativeDateFormat.URelativeString)o2;

                if (r1.offset == r2.offset)
                {
                    return(0);
                }
                else if (r1.offset < r2.offset)
                {
                    return(-1);
                }
                else
                {
                    return(1);
                }
            }
Esempio 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);
        }