public class ArrayDataList<DATATYPE extends Data> extends AbstractDataList<DATATYPE>
AbstractDataList.DrainOnGetFuture<DATATYPE extends Data>
Modifier and Type | Field and Description |
---|---|
private com.yahoo.collections.FreezableArrayList<DATATYPE> |
dataList |
Modifier | Constructor and 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
|
Modifier and Type | Method and Description |
---|---|
DATATYPE |
add(DATATYPE data)
Adds a child data item to this.
|
void |
addDataListener(Runnable runnable)
Adds a listener which is invoked every time data is added to this list.
|
List<DATATYPE> |
asList()
Returns a reference to the list backing this.
|
static <DATATYPE extends Data> |
create(Request request)
Creates a simple data list which does not allow late incoming data
|
static <DATATYPE extends Data> |
createAsync(Request request)
Creates an instance of this which supports incoming data through the default mechanism (DefaultIncomingData)
|
static <DATATYPE extends Data> |
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> |
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
|
complete, incoming, isOrdered, isStreamed, request, toString
addFreezeListener, clone
protected ArrayDataList(Request request)
request
- the request which created this data listprotected ArrayDataList(Request request, IncomingData<DATATYPE> incomingData)
request
- the request which created this data list, never nullincomingData
- the recipient of incoming data to this list, never nullprotected ArrayDataList(Request request, IncomingData<DATATYPE> incomingData, boolean ordered, boolean streamed)
request
- the request which created this data list, never nullincomingData
- the recipient of incoming data to this list, never nullpublic static <DATATYPE extends Data> ArrayDataList<DATATYPE> create(Request request)
request
- the request which created this data listpublic static <DATATYPE extends Data> ArrayDataList<DATATYPE> createAsync(Request request)
public static <DATATYPE extends Data> ArrayDataList<DATATYPE> createAsyncUnordered(Request request)
public static <DATATYPE extends Data> ArrayDataList<DATATYPE> createAsyncNonstreamed(Request request)
public DATATYPE add(DATATYPE data)
DataList
data
- the data to add to thispublic DATATYPE get(int index)
public List<DATATYPE> asList()
public void addDataListener(Runnable runnable)
DataList
public void freeze()
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.
freeze
in interface com.yahoo.component.provider.Freezable
freeze
in class com.yahoo.component.provider.ListenableFreezableClass
Copyright © 2018. All rights reserved.