DistributedList

DistributedList

This class contains methods and parameters for Distributed List


Constructor

# new DistributedList(key, cache, options, cls)

Parameters:
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.

Parameters:
Name Type Description
item Object

element to be appended to this list.

Returns:

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.)

Parameters:
Name Type Description
c Array

collection containing elements to be added to this list

Returns:

true if this list changed as a result of the call

Type
Boolean

# (async) addAtIndex(index, elemnet)

Parameters:
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.

Parameters:
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.

Parameters:
Name Type Description
collection Array

list containing the specified range of elements

# (async) contains(value) → {Boolean}

Parameters:
Name Type Description
value Object

value that will be searched

Returns:

Returns {@code true} if this list contains the specified element.

Type
Boolean

# (async) copyTo(array, arrayIndex)

Parameters:
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.

Returns:

The first element in the list.

Type
Object

# (async) get(index) → {Object}

Returns the element at the specified position in this list.

Parameters:
Name Type Description
index Number

index at which object will be returned from list

Returns:

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.

Parameters:
Name Type Description
start Number

starting point of range

count Number

ending point of range

Returns:
Type
Array

# (async) indexOf(item) → {Number}

Parameters:
Name Type Description
item Object

item whose index will be returned

Returns:
Type
Number

# (async) insertAfter(pivot, value) → {Boolean}

inserts the element in the list after the first occurrence of specified element.

Parameters:
Name Type Description
pivot Object

indicates object in the list after which new value will be inserted

value Object

value that will be inserted

Returns:

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.

Parameters:
Name Type Description
value Object

value that will be inserted

# (async) insertAtTail(value)

insert the specified value at the tail of the list.

Parameters:
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.

Parameters:
Name Type Description
pivot Object

indicates object in the list before which new value will be inserted

value Object

value that will be inserted

Returns:

False if the value pivot was not found; else true.

Type
Boolean

# isEmpty()

Returns {@code true} if this list contains no elements.

Returns:

Returns {@code true} if this list contains no elements.

# (async) iterator() → {Iterator}

Returns an iterator over the elements in this list in proper sequence.

Returns:

an iterator over the elements in this list in proper sequence

Type
Iterator

# (async) last() → {Object}

Returns the last element of the list.

Returns:

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.

Parameters:
Name Type Description
item Object

element to be removed from this list, if present

Returns:

True

Type
Boolean

# (async) removeAll(c) → {Boolean}

Removes from this list all of its elements that are contained in the specified collection (optional operation).

Parameters:
Name Type Description
c Array

collection containing elements to be removed from this list

Returns:

true if this list changed as a result of the call

Type
Boolean

# (async) removeChangeListener(dataTypeDataChangeListener, eventType)

Parameters:
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}

Parameters:
Name Type Description
index Number

index at which object will be removed from list

Returns:
Type
Object

# (async) removeRange(index, count)

Removes a list that will contain only the specified range of elements specified.

Parameters:
Name Type Description
index Number

starting point of list

count Number

number of elements to be removed starting from index

# (async) removeRangeCollection(collection) → {Number}

Parameters:
Name Type Description
collection Array

list containing the specified range of elements

Returns:

The number of removed elements.

Type
Number

# (async) set(index, elemnet) → {Object}

Parameters:
Name Type Description
index Number

index at which object will be replaced into list

elemnet Object

object to be replaced

Returns:
Type
Object

# size() → {Number}

returns number of elements in list

Returns:

Returns the number of elements in this list.

Type
Number

# (async) subList(fromIndex, toIndex) → {Array}

Parameters:
Name Type Description
fromIndex Number

starting point of list

toIndex Number

ending point of list

Returns:
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.

Parameters:
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.

Returns:

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.

Parameters:
Name Type Description
start Number

starting point of range

end Number

ending point of range