APIdia Launch Partner
Top Fields Constructors Methods
com.sun.jmx.remote.internal

public Class ArrayQueue<T>

extends AbstractList<T>
Class Inheritance
Imports
java.util.AbstractList, .Iterator

Field Summary

Modifier and TypeField and Description
private int
private int
private T[]
private int
Inherited from java.util.AbstractList:
modCount

Constructor Summary

AccessConstructor and Description
public
ArrayQueue(int capacity)

Method Summary

Modifier and TypeMethod and Description
public boolean
add(T o)

Overrides java.util.AbstractList.add.

Implements java.util.List.add, java.util.Collection.add.

Appends the specified element to the end of this list (optional operation).

public T
get(int i)

Implements abstract java.util.AbstractList.get.

Implements java.util.List.get.

Returns the element at the specified position in this list.

private T[]
newArray(int size)

public T
remove(int i)

Overrides java.util.AbstractList.remove.

Implements java.util.List.remove.

Removes the element at the specified position in this list (optional operation).

public void
resize(int newcapacity)

public int
size()

Implements abstract java.util.AbstractCollection.size.

Implements java.util.List.size, java.util.Collection.size.

Returns the number of elements in this list.

Inherited from java.util.AbstractList:
addaddAllclearequalshashCodeindexOfiteratorlastIndexOflistIteratorlistIteratorremoveRangesetsubList

Field Detail

capacityback to summary
private int capacity
queueback to summary
private T[] queue
tailback to summary
private int tail

Constructor Detail

ArrayQueueback to summary
public ArrayQueue(int capacity)

Method Detail

addback to summary
public boolean add(T o)

Overrides java.util.AbstractList.add.

Implements java.util.List.add, java.util.Collection.add.

Doc from java.util.AbstractList.add.

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.

getback to summary
public T get(int i)

Implements abstract java.util.AbstractList.get.

Implements java.util.List.get.

Doc from java.util.AbstractList.get.

Returns the element at the specified position in this list.

newArrayback to summary
private T[] newArray(int size)
Annotations
@SuppressWarnings:unchecked
removeback to summary
public T remove(int i)

Overrides java.util.AbstractList.remove.

Implements java.util.List.remove.

Doc from java.util.AbstractList.remove.

Removes the element at the specified position in this list (optional operation). Shifts any subsequent elements to the left (subtracts one from their indices). Returns the element that was removed from the list.

resizeback to summary
public void resize(int newcapacity)
sizeback to summary
public int size()

Implements abstract java.util.AbstractCollection.size.

Implements java.util.List.size, java.util.Collection.size.

Doc from java.util.List.size.

Returns the number of elements in this list. If this list contains more than Integer.MAX_VALUE elements, returns Integer.MAX_VALUE.