org.xnap.transfer
Class TransferQueue

java.lang.Object
  extended by org.xnap.transfer.TransferQueue

public class TransferQueue
extends java.lang.Object

This class manages transfers in a queue and notifies transfers when they are scheduled to start.


Field Summary
static int RESORT_INTERVAL
           
 
Constructor Summary
TransferQueue()
           
TransferQueue(int maxSlots)
           
 
Method Summary
 int add(Queueable item)
          Adds item to the queue.
 double calculatePriority(Queueable item)
           
 int getFreeSlots()
          Returns the number of free slots.
 boolean remove(Queueable item)
          Removes item from the queue and updates the position of all tail items.
 void resort()
           
 void setMaxSlots(int maxSlots)
          Sets the number of slots to maxSlots.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RESORT_INTERVAL

public static int RESORT_INTERVAL
Constructor Detail

TransferQueue

public TransferQueue(int maxSlots)

TransferQueue

public TransferQueue()
Method Detail

add

public int add(Queueable item)
Adds item to the queue.

Returns:
the queue position

calculatePriority

public double calculatePriority(Queueable item)

remove

public boolean remove(Queueable item)
Removes item from the queue and updates the position of all tail items.

Returns:
true, if item was removed; false, if item was not in queue

getFreeSlots

public int getFreeSlots()
Returns the number of free slots.


setMaxSlots

public void setMaxSlots(int maxSlots)
Sets the number of slots to maxSlots.


resort

public void resort()


Copyright © 2001-2005 XNap Team. All Rights Reserved.