Class ICUResource.ArraySink

  • Enclosing class:
    ICUResource

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

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

    • Constructor Detail

      • ArraySink

        public ArraySink()
    • Method Detail

      • put

        public void put​(int index,
                        ICUResource.Value value)
        Adds a value from a resource array.
        Parameters:
        index - of the resource array item
        value - resource value
      • getOrCreateArraySink

        public ICUResource.ArraySink getOrCreateArraySink​(int index,
                                                          int size)
        Returns a nested resource array at the array index 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:
        index - of the resource array item
        size - number of array items
        Returns:
        nested-array sink, or null
      • getOrCreateTableSink

        public ICUResource.TableSink getOrCreateTableSink​(int index,
                                                          int initialSize)
        Returns a nested resource table at the array index 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:
        index - of the resource array item
        initialSize - size hint for creating the sink if necessary
        Returns:
        nested-table sink, or null