## org.mortbay.cometd.ext
Class ArrayIdQueue<E>

    java.lang.Object
      java.util.AbstractCollection<E>
          java.util.AbstractList<E>
              org.mortbay.util.ArrayQueue<E>
                  org.mortbay.cometd.ext.ArrayIdQueue<E>

All Implemented Interfaces:
  Iterable<E>, Collection<E>, List<E>, Queue<E>

    public class ArrayIdQueue<E>

extends ArrayQueue<E>

Field Summary

Fields inherited from class org.mortbay.util.ArrayQueue
`_elements, _growCapacity, _lock, _nextE, _nextSlot, _size, DEFAULT_CAPACITY, DEFAULT_GROWTH`

Fields inherited from class java.util.AbstractList
`modCount`

Constructor Summary
`ArrayIdQueue()`
`ArrayIdQueue(int capacity)`
`ArrayIdQueue(int initCapacity, int growBy)`
`ArrayIdQueue(int initCapacity, int growBy, Object lock)`

Method Summary
`boolean` `add(E e)`
`void` `add(int index, E element)`
`void` `addUnsafe(E e)` Add without synchronization or bounds checking
`int` `getAssociatedId(int index)`
`long` `getAssociatedIdUnsafe(int index)`
`int` `getCurrentId()`
`protected boolean` `grow()`
`void` `incrementCurrentId()`
`boolean` `offer(E e)`
`E` `remove(int index)`
`E` `set(int index, E element)`
`void` `setCurrentId(int currentId)`

Methods inherited from class org.mortbay.util.ArrayQueue
`clear, element, get, getCapacity, getUnsafe, isEmpty, peek, poll, remove, size`

Methods inherited from class java.util.AbstractList
`addAll, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, removeRange, subList`

Methods inherited from class java.util.AbstractCollection
`addAll, contains, containsAll, remove, removeAll, retainAll, toArray, toArray, toString`

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

Methods inherited from interface java.util.Collection
`addAll, contains, containsAll, equals, hashCode, iterator, remove, removeAll, retainAll, toArray, toArray`

Methods inherited from interface java.util.List
`addAll, contains, containsAll, remove, removeAll, retainAll, toArray, toArray`

Constructor Detail

### ArrayIdQueue

    public ArrayIdQueue()

### ArrayIdQueue

    public ArrayIdQueue(int capacity)

### ArrayIdQueue

    public ArrayIdQueue(int initCapacity,
                        int growBy)

### ArrayIdQueue

    public ArrayIdQueue(int initCapacity,
                        int growBy,
                        Object lock)

Method Detail

### getCurrentId

    public int getCurrentId()

  Returns:
    currentId the latest batch that has been sent to the client

### setCurrentId

    public void setCurrentId(int currentId)

### incrementCurrentId

    public void incrementCurrentId()

### add

    public boolean add(E e)

  Specified by:
    `add` in interface `Collection<E>`
  Specified by:
    `add` in interface `List<E>`
  Specified by:
    `add` in interface `Queue<E>`
  Overrides:
    `add` in class `ArrayQueue<E>`

### addUnsafe

    public void addUnsafe(E e)

  Description copied from class: `ArrayQueue`
  Add without synchronization or bounds checking

  Overrides:
    `addUnsafe` in class `ArrayQueue<E>`
  See Also:
    `ArrayQueue.add(Object)`

### offer

    public boolean offer(E e)

  Specified by:
    `offer` in interface `Queue<E>`
  Overrides:
    `offer` in class `ArrayQueue<E>`

### getAssociatedId

    public int getAssociatedId(int index)

### getAssociatedIdUnsafe

    public long getAssociatedIdUnsafe(int index)

### remove

    public E remove(int index)

  Specified by:
    `remove` in interface `List<E>`
  Overrides:
    `remove` in class `ArrayQueue<E>`

### set

    public E set(int index,
                 E element)

  Specified by:
    `set` in interface `List<E>`
  Overrides:
    `set` in class `ArrayQueue<E>`

### add

    public void add(int index,
                    E element)

  Specified by:
    `add` in interface `List<E>`
  Overrides:
    `add` in class `ArrayQueue<E>`

### grow

    protected boolean grow()

  Overrides:
    `grow` in class `ArrayQueue<E>`

Copyright © 1995-2010 Mort Bay Consulting. All Rights Reserved.