Class ArrayDataList<DATATYPE extends Data>

    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected ArrayDataList​(Request request)
      Creates a simple data list which does not allow late incoming data
      protected ArrayDataList​(Request request, IncomingData<DATATYPE> incomingData)
      Creates a simple data list which receives incoming data in the given instance
      protected ArrayDataList​(Request request, IncomingData<DATATYPE> incomingData, boolean ordered, boolean streamed)
      Creates a simple data list which receives incoming data in the given instance
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      DATATYPE add​(DATATYPE data)
      Adds a child data item to this.
      void addDataListener​(java.lang.Runnable runnable)
      Adds a listener which is invoked every time data is added to this list.
      java.util.List<DATATYPE> asList()
      Returns a reference to the list backing this.
      static <DATATYPE extends Data>
      ArrayDataList<DATATYPE>
      create​(Request request)
      Creates a simple data list which does not allow late incoming data
      static <DATATYPE extends Data>
      ArrayDataList<DATATYPE>
      createAsync​(Request request)
      Creates an instance of this which supports incoming data through the default mechanism (DefaultIncomingData)
      static <DATATYPE extends Data>
      ArrayDataList<DATATYPE>
      createAsyncNonstreamed​(Request request)
      Creates an instance of this which supports incoming data through the default mechanism (DefaultIncomingData) and where this data cannot be returned to clients until this is completed.
      static <DATATYPE extends Data>
      ArrayDataList<DATATYPE>
      createAsyncUnordered​(Request request)
      Creates an instance of this which supports incoming data through the default mechanism (DefaultIncomingData), and where this data can be rendered in any order.
      void freeze()
      Irreversibly prevent further changes to the items of this.
      DATATYPE get​(int index)
      Returns the data element at index
      • Methods inherited from class com.yahoo.component.provider.ListenableFreezableClass

        addFreezeListener, clone
      • Methods inherited from class com.yahoo.component.provider.FreezableClass

        ensureNotFrozen, isFrozen
      • Methods inherited from class java.lang.Object

        equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface com.yahoo.processing.response.DataList

        close
      • Methods inherited from interface com.yahoo.component.provider.Freezable

        isFrozen
      • Methods inherited from interface com.yahoo.component.provider.ListenableFreezable

        addFreezeListener
    • Constructor Detail

      • ArrayDataList

        protected ArrayDataList​(Request request)
        Creates a simple data list which does not allow late incoming data
        Parameters:
        request - the request which created this data list
      • ArrayDataList

        protected ArrayDataList​(Request request,
                                IncomingData<DATATYPE> incomingData)
        Creates a simple data list which receives incoming data in the given instance
        Parameters:
        request - the request which created this data list, never null
        incomingData - the recipient of incoming data to this list, never null
      • ArrayDataList

        protected ArrayDataList​(Request request,
                                IncomingData<DATATYPE> incomingData,
                                boolean ordered,
                                boolean streamed)
        Creates a simple data list which receives incoming data in the given instance
        Parameters:
        request - the request which created this data list, never null
        incomingData - the recipient of incoming data to this list, never null
    • Method Detail

      • create

        public static <DATATYPE extends DataArrayDataList<DATATYPE> create​(Request request)
        Creates a simple data list which does not allow late incoming data
        Parameters:
        request - the request which created this data list
      • createAsync

        public static <DATATYPE extends DataArrayDataList<DATATYPE> createAsync​(Request request)
        Creates an instance of this which supports incoming data through the default mechanism (DefaultIncomingData)
      • createAsyncUnordered

        public static <DATATYPE extends DataArrayDataList<DATATYPE> createAsyncUnordered​(Request request)
        Creates an instance of this which supports incoming data through the default mechanism (DefaultIncomingData), and where this data can be rendered in any order.
      • createAsyncNonstreamed

        public static <DATATYPE extends DataArrayDataList<DATATYPE> createAsyncNonstreamed​(Request request)
        Creates an instance of this which supports incoming data through the default mechanism (DefaultIncomingData) and where this data cannot be returned to clients until this is completed.
      • add

        public DATATYPE add​(DATATYPE data)
        Description copied from interface: DataList
        Adds a child data item to this.
        Parameters:
        data - the data to add to this
        Returns:
        the input data instance, for chaining
      • get

        public DATATYPE get​(int index)
        Returns the data element at index
      • asList

        public java.util.List<DATATYPE> asList()
        Returns a reference to the list backing this. The list may be modified freely, unless this is frozen. If frozen, the only permissible write operations are those that add new items to the end of the list.
      • addDataListener

        public void addDataListener​(java.lang.Runnable runnable)
        Description copied from interface: DataList
        Adds a listener which is invoked every time data is added to this list. The listener is always invoked on the same thread which is adding the data, and hence it can modify this list freely without synchronization.
      • freeze

        public void freeze()
        Irreversibly prevent further changes to the items of this. This allows the processing engine to start streaming the current content of this list back to the client (if applicable).

        Adding new items to the end of this list is permitted even after freeze. If frozen, those items may be streamed back to the client immediately on add.

        Calling this on a frozen list has no effect.

        Specified by:
        freeze in interface com.yahoo.component.provider.Freezable
        Overrides:
        freeze in class com.yahoo.component.provider.ListenableFreezableClass