Package com.ibm.icu.impl
Class ICUService.SimpleFactory
- java.lang.Object
-
- com.ibm.icu.impl.ICUService.SimpleFactory
-
- All Implemented Interfaces:
ICUService.Factory
- Enclosing class:
- ICUService
public static class ICUService.SimpleFactory extends Object implements ICUService.Factory
A default implementation of factory. This provides default implementations for subclasses, and implements a singleton factory that matches a single id and returns a single (possibly deferred-initialized) instance. This implements updateVisibleIDs to add a mapping from its ID to itself if visible is true, or to remove any existing mapping for its ID if visible is false.
-
-
Constructor Summary
Constructors Constructor Description SimpleFactory(Object instance, String id)Convenience constructor that calls SimpleFactory(Object, String, boolean) with visible true.SimpleFactory(Object instance, String id, boolean visible)Construct a simple factory that maps a single id to a single service instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Objectcreate(ICUService.Key key, ICUService service)Return the service instance if the factory's id is equal to the key's currentID.StringgetDisplayName(String identifier, ULocale locale)If this.id equals id, returns id regardless of locale, otherwise returns null.StringtoString()For debugging.voidupdateVisibleIDs(Map<String,ICUService.Factory> result)If visible, adds a mapping from id -> this to the result, otherwise removes id from result.
-
-
-
Method Detail
-
create
public Object create(ICUService.Key key, ICUService service)
Return the service instance if the factory's id is equal to the key's currentID. Service is ignored.- Specified by:
createin interfaceICUService.Factory
-
updateVisibleIDs
public void updateVisibleIDs(Map<String,ICUService.Factory> result)
If visible, adds a mapping from id -> this to the result, otherwise removes id from result.- Specified by:
updateVisibleIDsin interfaceICUService.Factory
-
getDisplayName
public String getDisplayName(String identifier, ULocale locale)
If this.id equals id, returns id regardless of locale, otherwise returns null. (This default implementation has no localized id information.)- Specified by:
getDisplayNamein interfaceICUService.Factory
-
-