Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## oracle.ifs.utils.common
Class Deque

    java.lang.Object
      oracle.ifs.utils.common.Deque

    public class Deque

extends java.lang.Object

This is a utility class implementing a deque. A deque is basically a double ended queue. With a queue, you put elements in the back and take them out from the front. With a stack, you put elements in the front, and take them out from the front as well. A deque allows you to put elements in either the back or front, and take them out from the back or front. This particular implementation of a deque uses a circular buffer that grows when more space is needed. The push and pop operations all execute in constant amortized time. Note that this class is unsynchronized, and therefore not threadsafe. This is done to give a performance benefit for single threaded usage. If you need a threadsafe deque, just synchronize on every method call. Or, subclass Deque and make all of the methods synchronized.

Field Summary
`protected int` | `m_Back` the index into m_Objs that indicates the back of the queue
`protected int` | `m_Len` the number of elements in the Deque
`protected java.lang.Object[]` | `m_Objs`

Constructor Summary
`Deque()` Construct an empty Deque.
`Deque(int size)` Construct an empty Deque with the provided initial buffer size.

Method Summary
`void` | `copyInto(java.lang.Object[] dest)` Copy every element in this Deque into the given array.
`void` | `copyInto(java.lang.Object[] dest, int offset)` Copy every element in this Deque into the given array, starting at the given offset into the array.
`java.lang.Object` | `popBack()` Remove an object from the back of this Deque
`java.lang.Object` | `popFront()` Remove an object from the front of this Deque
`void` | `pushBack(java.lang.Object o)` Insert an object on the back of this Deque
`void` | `pushFront(java.lang.Object o)` Insert an object on the front of this Deque
`int` | `size()` Return the number of elements currently in this Deque.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### m_Objs

    protected java.lang.Object[] m_Objs

### m_Back

    protected int m_Back

  Description copied from class: `Deque`
  the index into m_Objs that indicates the back of the queue

### m_Len

    protected int m_Len

  Description copied from class: `Deque`
  the number of elements in the Deque

Constructor Detail

### Deque

    public Deque()

  Construct an empty Deque.

### Deque

    public Deque(int size)

  Construct an empty Deque with the provided initial buffer size.

  Parameters:
    `size` - - the initial capacity of this Deque

Method Detail

### pushFront

    public void pushFront(java.lang.Object o)

  Description copied from class: `Deque`
  Insert an object on the front of this Deque

  Parameters:
    `o` - - the object to insert

### pushBack

    public void pushBack(java.lang.Object o)

  Description copied from class: `Deque`
  Insert an object on the back of this Deque

  Parameters:
    `o` - - the object to insert

### popFront

    public java.lang.Object popFront()

  Description copied from class: `Deque`
  Remove an object from the front of this Deque

  Returns:
    the object removed

### popBack

    public java.lang.Object popBack()

  Description copied from class: `Deque`
  Remove an object from the back of this Deque

  Returns:
    the object removed

### size

    public int size()

  Description copied from class: `Deque`
  Return the number of elements currently in this Deque.

### copyInto

    public void copyInto(java.lang.Object[] dest)

  Description copied from class: `Deque`
  Copy every element in this Deque into the given array.

  Parameters:
    `dest` - - the destination array

### copyInto

    public void copyInto(java.lang.Object[] dest,
                         int offset)

  Description copied from class: `Deque`
  Copy every element in this Deque into the given array, starting at the given offset into the array.

  Parameters:
    `dest` - - the destination array
    `offset` - - the index into dest at which the copying begins.

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD