Exemplo n.º 1
0
 /// <summary>
 /// Return the service instance if the factory's id is equal to the key's
 /// currentID. Service is ignored.
 /// </summary>
 ///
 public virtual Object Create(ICUService.Key key, ICUService service)
 {
     if (id.Equals(key.CurrentID()))
     {
         return(instance);
     }
     return(null);
 }
Exemplo n.º 2
0
 /// <summary>
 /// Returns the service object if kind/locale match. Service is not used.
 /// </summary>
 ///
 public override Object Create(ICUService.Key key, ICUService service)
 {
     ICULocaleService.LocaleKey lkey = (ICULocaleService.LocaleKey)key;
     if (kind == IBM.ICU.Impl.ICULocaleService.LocaleKey.KIND_ANY || kind == lkey.Kind())
     {
         String keyID = lkey.CurrentID();
         if (id.Equals(keyID))
         {
             return(obj);
         }
     }
     return(null);
 }
Exemplo n.º 3
0
            /// <summary>
            /// Implement superclass abstract method. This checks the currentID of
            /// the key against the supported IDs, and passes the canonicalLocale and
            /// kind off to handleCreate (which subclasses must implement).
            /// </summary>
            ///
            public virtual Object Create(ICUService.Key key, ICUService service)
            {
                if (HandlesKey(key))
                {
                    ICULocaleService.LocaleKey lkey = (ICULocaleService.LocaleKey)key;
                    int kind_0 = lkey.Kind();

                    ULocale uloc = lkey.CurrentLocale();
                    return(HandleCreate(uloc, kind_0, service));
                }
                else
                {
                    // System.out.println("factory: " + this +
                    // " did not support id: " + key.currentID());
                    // System.out.println("supported ids: " + getSupportedIDs());
                }
                return(null);
            }
Exemplo n.º 4
0
 /// <summary>
 /// Create the service. The default implementation returns the resource
 /// bundle for the locale, ignoring kind, and service.
 /// </summary>
 ///
 protected internal override Object HandleCreate(ULocale loc, int kind_0, ICUService service)
 {
     return(IBM.ICU.Util.UResourceBundle.GetBundleInstance(bundleName, loc));
 }
Exemplo n.º 5
0
 // /CLOVER:OFF
 /// <summary>
 /// Utility method used by create(Key, ICUService). Subclasses can
 /// implement this instead of create.
 /// </summary>
 ///
 protected internal virtual Object HandleCreate(ULocale loc, int kind_0, ICUService service)
 {
     return(null);
 }