Overview | Package | Class | Tree | Index | Help

Oracle® Coherence Java API Reference
v3.5.3
E15583-01
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.tangosol.net
Class LoadBalancer.Queue

    java.lang.Object
      com.tangosol.util.Base
          com.tangosol.net.LoadBalancer.Queue

Enclosing class:
  LoadBalancer

    public static class LoadBalancer.Queue

extends Base

A Queue is used to effeciently queue up items for daemon threads to work on.

Field Summary
`protected java.util.List` | `m_list` A list of items that have been queued.

Constructor Summary
`LoadBalancer.Queue()` Construct a queue.

Method Summary
`void` | `add(java.lang.Object o)` Add an object to the end of the queue.
`boolean` | `isEmpty()` Determine if the queue is empty.
`java.lang.Object` | `remove()` Wait for and remove an item from the from of the queue.
`java.lang.Object` | `removeNoWait()` Remove an item from the queue if the queue is not empty.
`int` | `size()` Determine the number of items in the queue.

Field Detail

### m_list

    protected java.util.List m_list

  A list of items that have been queued.

Constructor Detail

### LoadBalancer.Queue

    public LoadBalancer.Queue()

  Construct a queue.

Method Detail

### size

    public int size()

  Determine the number of items in the queue.

  Returns:
    the number of items in the queue

### isEmpty

    public boolean isEmpty()

  Determine if the queue is empty.

  Returns:
    true if the queue currently has no items in it

### add

    public void add(java.lang.Object o)

  Add an object to the end of the queue.

  Parameters:
    `o` - the item to add to the end of the queue

### remove

    public java.lang.Object remove()
                            throws java.lang.InterruptedException

  Wait for and remove an item from the from of the queue.

  Returns:
    an item from the queue
  Throws:
    `java.lang.InterruptedException` - if the thread is interrupted while waiting for something to be added to the queue

### removeNoWait

    public java.lang.Object removeNoWait()

  Remove an item from the queue if the queue is not empty.

  Returns:
    an item if the queue is not empty, otherwise null

Overview | Package | Class | Tree | Index | Help

Oracle® Coherence Java API Reference
v3.5.3
E15583-01
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2000, 2010, Oracle. All rights reserved.