org.apache.jcs.utils.struct
Class BoundedQueue

java.lang.Object
  extended by org.apache.jcs.utils.struct.BoundedQueue

public class BoundedQueue
extends java.lang.Object

This is a bounded queue. It only allows maxSize items.

Author:
Aaron Smuts

Constructor Summary
BoundedQueue(int maxSize)
          Initialize the bounded queue.
 
Method Summary
 void add(java.lang.Object object)
          Adds an item to the end of the queue, which is the front of the list.
 boolean isEmpty()
          Return true if the size is <= 0;
 int size()
          Return the number of items in the queue.
 java.lang.Object take()
          Takes the last of the underlying double linked list.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BoundedQueue

public BoundedQueue(int maxSize)
Initialize the bounded queue.

Parameters:
maxSize -
Method Detail

add

public void add(java.lang.Object object)
Adds an item to the end of the queue, which is the front of the list.

Parameters:
object -

take

public java.lang.Object take()
Takes the last of the underlying double linked list.

Returns:
null if it is epmpty.

size

public int size()
Return the number of items in the queue.

Returns:
size

isEmpty

public boolean isEmpty()
Return true if the size is <= 0;

Returns:
true is size <= 0;


Copyright © 2002-2009 Apache Software Foundation. All Rights Reserved.