DistributedQueue

DistributedQueue

This class contains methods and parameters for Distributed Queue


Constructor

# new DistributedQueue(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}

Adds an object to the end of the Queue.

Parameters:
Name Type Description
item Object

the element to add

Returns:

true

Type
boolean

# (async) addChangeListener(dataTypeDataChangeListener, eventType, dataFilter)

Parameters:
Name Type Description
dataTypeDataChangeListener DataStructureDataChangeListener

callback method to be called

eventType Array.<EventType>

indicates eventtype on which callback method will be called

dataFilter DataTypeEventDataFilter

indicates type of data that will be recieved

# (async) clear()

Removes all objects from the Queue.

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

Determines whether the element exists in Queue.

Parameters:
Name Type Description
value Object

value to be found

Returns:
Type
Boolean

# (async) copyTo(array, arrayIndex)

Copies the Queue elements to the specified array, starting at the specified index.

Parameters:
Name Type Description
array Array

indicates the list of elements that need to be copied

arrayIndex Number

indicates starting point of array from where copying will get start.

# (async) element() → {Object}

Retrieves, but does not remove, the head of this queue. This method differs from peek only in that it throws an exception if this queue is empty.

Returns:

the head of this queue

Type
Object

# isEmpty()

checks if the queue is empty

Returns:

boolean

# (async) iterator() → {Iterator.<T>}

returns iterator over Queue

Returns:
Type
Iterator.<T>

# (async) offer(item) → {boolean}

Inserts the specified element into this queue if it is possible to do so immediately without violating capacity restrictions. When using a capacity-restricted queue, this method is generally preferable to add, which can fail to insert an element only by throwing an exception.

Parameters:
Name Type Description
item Object

the element to add

Returns:

true

Type
boolean

# (async) peek() → {Object}

Retrieves, but does not remove, the head of this queue, or returns null if this queue is empty.

Returns:

the head of this queue, or null if this queue is empty

Type
Object

# (async) poll()

Returns:

the head of this queue, or null if this queue is empty

# (async) remove() → {Object}

Removes and returns the object at the beginning of the Queue.

Returns:

the head of this queue

Type
Object

# (async) removeChangeListener(dataTypeDataChangeListener, eventType)

Parameters:
Name Type Description
dataTypeDataChangeListener DataStructureDataChangeListener

callback method to be called

eventType Array.<EventType>

indicates eventtype on which callback method will be called

# size()

returns the number of elements present in queue

Returns:

number

# (async) toArray(a)

Parameters:
Name Type Default Description
a Array null

the array into which the elements of this collection 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 collection

# toString()

returns the stringified version of class name

Returns:

string