Cytoscape 2.8.0 API

cytoscape.util.intr
Class IntQueue

java.lang.Object
  extended by cytoscape.util.intr.IntQueue
All Implemented Interfaces:
Serializable

public final class IntQueue
extends Object
implements Serializable

A first-in, first-out container of 32 bit integers. In the underlying implementation, the memory consumed by an instance of this class may increase, but does never decrease.

While other container classes in this package are able to hold up to Integer.MAX_VALUE elements, this class is only able to hold Integer.MAX_VALUE-1 elements.

An instance of this class is serializable; however, serialized instances of this class should not be stored in a persistent manner because the serialization implemented in this class makes no attempt at handling class versioning.

See Also:
Serialized Form

Constructor Summary
IntQueue()
          Creates a new queue of integers.
 
Method Summary
 int dequeue()
          Removes and returns the next integer in this queue.
 IntEnumerator elements()
          Returns an enumeration of all elements currently in this queue.
 void empty()
          Removes all integers from this queue.
 void enqueue(int value)
          Inserts a new integer into this queue.
 int peek()
          A non-mutating operation that retrieves the next integer in this queue.
 int size()
          Returns the number of integers that are currently in this queue.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IntQueue

public IntQueue()
Creates a new queue of integers.

Method Detail

empty

public final void empty()
Removes all integers from this queue. This operation has constant time complexity.


size

public final int size()
Returns the number of integers that are currently in this queue.


enqueue

public final void enqueue(int value)
Inserts a new integer into this queue.


peek

public final int peek()
A non-mutating operation that retrieves the next integer in this queue.

It is considered an error to call this method if there are no integers currently in this queue. If size() returns zero immediately before this method is called, the results of this operation are undefined.


dequeue

public final int dequeue()
Removes and returns the next integer in this queue.

It is considered an error to call this method if there are no integers currently in this queue. If size() returns zero immediately before this method is called, the results of this operation are undefined.


elements

public final IntEnumerator elements()
Returns an enumeration of all elements currently in this queue. The order of elements in the returned enumeration is based on the elements' dequeue order; the first element returned is the element waiting to be dequeued.

No operation on this queue will have an effect on the returned enumeration except for enqueue(). If calls to enqueue() are mingled with calls to iterate over the returned enumeration, the contents of this enumeration become undefined. Iterating over the returned enumeration never has an affect on this queue.


Cytoscape 2.8.0 API

Copyright 2010 Cytoscape Consortium. All rights reserved.