Class ICUResource.TableSink

  • Enclosing class:
    ICUResource

    public static class ICUResource.TableSink
    extends Object
    Sink for ICU resource table contents. The base class does nothing.

    Nested arrays and tables are stored as nested sinks, never put() as ICUResource.Value items.

    • Constructor Detail

      • TableSink

        public TableSink()
    • Method Detail

      • put

        public void put​(ICUResource.Key key,
                        ICUResource.Value value)
        Adds a key-value pair from a resource table.
        Parameters:
        key - resource key string
        value - resource value
      • putNoFallback

        public void putNoFallback​(ICUResource.Key key)
        Adds a no-fallback/no-inheritance marker for this key. Used for CLDR no-fallback data values of "∅∅∅" when enumerating tables with fallback from the specific resource bundle to root.

        The default implementation does nothing.

        Parameters:
        key - to be removed
      • getOrCreateArraySink

        public ICUResource.ArraySink getOrCreateArraySink​(ICUResource.Key key,
                                                          int size)
        Returns a nested resource array for the key as another sink. Creates the sink if none exists for the key. Returns null if nested arrays are not supported. The default implementation always returns null.
        Parameters:
        key - resource key string
        size - number of array items
        Returns:
        nested-array sink, or null
      • getOrCreateTableSink

        public ICUResource.TableSink getOrCreateTableSink​(ICUResource.Key key,
                                                          int initialSize)
        Returns a nested resource table for the key as another sink. Creates the sink if none exists for the key. Returns null if nested tables are not supported. The default implementation always returns null.
        Parameters:
        key - resource key string
        initialSize - size hint for creating the sink if necessary
        Returns:
        nested-table sink, or null