org.apache.ftpserver.util
Class Queue

java.lang.Object
  extended byorg.apache.ftpserver.util.Queue

public class Queue
extends java.lang.Object

Queue (first in first out) implementation. It supports two types of queues.

Null values cannot be inserted.

Author:
Rana Bhattacharyya

Constructor Summary
Queue(boolean bWait)
          Constructor.
 
Method Summary
 void clear()
          Remove all the elements.
 java.lang.Object get()
          Try to get the first element.
 java.lang.Object get(long waitTimeMillis)
          Try to get the first element.
 int getMaxSize()
          Get max size
 boolean isEmpty()
          Is the list empty (size == 0)
 void put(java.lang.Object obj)
          Put an object into the queue and notify the waiting thread.
 void setMaxSize(int maxSize)
          Set max size
 int size()
          Get the number of elements in the queue.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Queue

public Queue(boolean bWait)
Constructor.

Parameters:
bWait - - thread will wait or not
Method Detail

get

public java.lang.Object get()
Try to get the first element. If the list is empty, the thread will wait. If interrupted returns null.


get

public java.lang.Object get(long waitTimeMillis)
Try to get the first element. If the list is empty, the thread will wait. If interrupted returns null.


put

public void put(java.lang.Object obj)
Put an object into the queue and notify the waiting thread.


size

public int size()
Get the number of elements in the queue.


getMaxSize

public int getMaxSize()
Get max size


setMaxSize

public void setMaxSize(int maxSize)
Set max size


isEmpty

public boolean isEmpty()
Is the list empty (size == 0)


clear

public void clear()
Remove all the elements.



Copyright © -2005 . All Rights Reserved.