Constructor
# new DistributedList(key, cache, options, cls)
Name | Type | Description |
---|---|---|
key |
String | key |
cache |
Cache | cache instance |
options |
WriteThruOptions | indicates options for writethruoptions |
cls |
Number | indicates type of json data |
Methods
# (async) add(item) → {Boolean}
Appends the specified element to the end of this list (optional operation). Lists that support this operation may place limitations on what elements may be added to this list. In particular, some lists will refuse to add null elements, and others will impose restrictions on the type of elements that may be added. List classes should clearly specify in their documentation any restrictions on what elements may be added.
Name | Type | Description |
---|---|---|
item |
Object | element to be appended to this list. |
True
- Type
- Boolean
# (async) addAll(c) → {Boolean}
Appends all of the elements in the specified collection to the end of this list, in the order that they are returned by the specified collection's iterator (optional operation). The behavior of this operation is undefined if the specified collection is modified while the operation is in progress. (Note that this will occur if the specified collection is this list, and it's nonempty.)
Name | Type | Description |
---|---|---|
c |
Array | collection containing elements to be added to this list |
true if this list changed as a result of the call
- Type
- Boolean
# (async) addAtIndex(index, elemnet)
Name | Type | Description |
---|---|---|
index |
Number | index at which object will be inserted into list |
elemnet |
Object | object to be inserted |
# (async) addChangeListener(dataTypeDataChangeListener, eventType, dataFilter)
Allows you to register collection event notifications like Add, Update, and Remove on the collection.
Name | Type | Description |
---|---|---|
dataTypeDataChangeListener |
DataStructureDataChangeListener | The listener that is invoked when an item is added, updated or removed from the cache. |
eventType |
Array.<EventType> | The event type/types that are to be registered. |
dataFilter |
DataTypeEventDataFilter | An enum which allows you to specify to which extent you want the data with the event. |
# (async) addRange(collection)
Adds a list that will contain only the specified range of elements.
Name | Type | Description |
---|---|---|
collection |
Array | list containing the specified range of elements |
# (async) contains(value) → {Boolean}
Name | Type | Description |
---|---|---|
value |
Object | value that will be searched |
Returns {@code true} if this list contains the specified element.
- Type
- Boolean
# (async) copyTo(array, arrayIndex)
Name | Type | Description |
---|---|---|
array |
Array | indicates list of objects that will be copied |
arrayIndex |
Number | starting point of list |
# (async) first() → {Object}
Returns the first element of the list.
The first element in the list.
- Type
- Object
# (async) get(index) → {Object}
Returns the element at the specified position in this list.
Name | Type | Description |
---|---|---|
index |
Number | index at which object will be returned from list |
the element at the specified position in this list
- Type
- Object
# (async) getRange(start, count) → {Array}
Returns a list that will contain only the specified range of elements specified.
Name | Type | Description |
---|---|---|
start |
Number | starting point of range |
count |
Number | ending point of range |
- Type
- Array
# (async) indexOf(item) → {Number}
Name | Type | Description |
---|---|---|
item |
Object | item whose index will be returned |
- Type
- Number
# (async) insertAfter(pivot, value) → {Boolean}
inserts the element in the list after the first occurrence of specified element.
Name | Type | Description |
---|---|---|
pivot |
Object | indicates object in the list after which new value will be inserted |
value |
Object | value that will be inserted |
False if the value pivot was not found; else true.
- Type
- Boolean
# (async) insertAtHead(value)
insert the specified value at the head of the list.
Name | Type | Description |
---|---|---|
value |
Object | value that will be inserted |
# (async) insertAtTail(value)
insert the specified value at the tail of the list.
Name | Type | Description |
---|---|---|
value |
Object | value that will be inserted |
# (async) insertBefore(pivot, value) → {Boolean}
Inserts the element in the list before the first occurrence of specified element.
Name | Type | Description |
---|---|---|
pivot |
Object | indicates object in the list before which new value will be inserted |
value |
Object | value that will be inserted |
False if the value pivot was not found; else true.
- Type
- Boolean
# isEmpty()
Returns {@code true} if this list contains no elements.
Returns {@code true} if this list contains no elements.
# (async) iterator() → {Iterator}
Returns an iterator over the elements in this list in proper sequence.
an iterator over the elements in this list in proper sequence
- Type
- Iterator
# (async) last() → {Object}
Returns the last element of the list.
the last element of the list.
- Type
- Object
# (async) remove(item) → {Boolean}
Removes the first occurrence of the specified element from this list, if it is present (optional operation). If this list does not contain the element, it is unchanged.
Name | Type | Description |
---|---|---|
item |
Object | element to be removed from this list, if present |
True
- Type
- Boolean
# (async) removeAll(c) → {Boolean}
Removes from this list all of its elements that are contained in the specified collection (optional operation).
Name | Type | Description |
---|---|---|
c |
Array | collection containing elements to be removed from this list |
true if this list changed as a result of the call
- Type
- Boolean
# (async) removeChangeListener(dataTypeDataChangeListener, eventType)
Name | Type | Description |
---|---|---|
dataTypeDataChangeListener |
DataStructureDataChangeListener | The listener that was registered with collection changed notification. |
eventType |
Array.<EventType> | The event type/types that are to be unregistered. |
# (async) removeIndex(index) → {Object}
Name | Type | Description |
---|---|---|
index |
Number | index at which object will be removed from list |
- Type
- Object
# (async) removeRange(index, count)
Removes a list that will contain only the specified range of elements specified.
Name | Type | Description |
---|---|---|
index |
Number | starting point of list |
count |
Number | number of elements to be removed starting from index |
# (async) removeRangeCollection(collection) → {Number}
Name | Type | Description |
---|---|---|
collection |
Array | list containing the specified range of elements |
The number of removed elements.
- Type
- Number
# (async) set(index, elemnet) → {Object}
Name | Type | Description |
---|---|---|
index |
Number | index at which object will be replaced into list |
elemnet |
Object | object to be replaced |
- Type
- Object
# size() → {Number}
returns number of elements in list
Returns the number of elements in this list.
- Type
- Number
# (async) subList(fromIndex, toIndex) → {Array}
Name | Type | Description |
---|---|---|
fromIndex |
Number | starting point of list |
toIndex |
Number | ending point of list |
- Type
- Array
# (async) toArray(a) → {Array}
The returned array will be "safe" in that no references to it are maintained by this list. (In other words, this method must allocate a new array even if this list is backed by an array). The caller is thus free to modify the returned array.
This method acts as bridge between array-based and collection-based APIs.
Name | Type | Default | Description |
---|---|---|---|
a |
Array | null | array into which the elements of this list are to be stored, if it is big enough; otherwise, a new array of the same runtime type is allocated for this purpose. |
an array containing all of the elements in this list in proper sequence
- Type
- Array
# (async) trim(start, end)
Trim an existing list so that it will contain only the specified range of elements specified.
Name | Type | Description |
---|---|---|
start |
Number | starting point of range |
end |
Number | ending point of range |