org.apache.jcs.utils.struct
Class BoundedQueue<T>

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

public class BoundedQueue<T>
extends 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(T 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.
 T 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(T object)
Adds an item to the end of the queue, which is the front of the list.

Parameters:
object -

take

public T 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-2013 The Apache Software Foundation. All Rights Reserved.