| java.lang.Object net.matuschek.spider.HashedMemoryTaskList
HashedMemoryTaskList | public class HashedMemoryTaskList implements TaskList(Code) | | Memory based implementation of the TaskList interface.
Uses a LinkedList for sequential access
and a HashSet for fast retrieval
To be thread safe, all methods are synchronized.
author: Daniel Matuschek, Jo Christen, Oliver Schmidt version: $Id: HashedMemoryTaskList.java,v 1.7 2004/08/09 13:07:22 matuschd Exp $* |
Constructor Summary | |
public | HashedMemoryTaskList() Standard constructor. | public | HashedMemoryTaskList(boolean sequentialAccess) Constructor with sequentialAccess-flag
Parameters: sequentialAccess - can be set to false if the removeFirstand elementAt methods are not used. | public | HashedMemoryTaskList(boolean sequentialAccess, int initialCapacity) Constructor with sequentialAccess-flag and initialCapacity.
Parameters: sequentialAccess - can be set to false if the removeFirst Parameters: initial - capacity (expected document count)and elementAt methods are not used. |
DEFAULT_CAPACITY | public static int DEFAULT_CAPACITY(Code) | | |
HashedMemoryTaskList | public HashedMemoryTaskList()(Code) | | Standard constructor.
(sequentialAccess=true, initialCapacity=DEFAULT_CAPACITY)
|
HashedMemoryTaskList | public HashedMemoryTaskList(boolean sequentialAccess)(Code) | | Constructor with sequentialAccess-flag
Parameters: sequentialAccess - can be set to false if the removeFirstand elementAt methods are not used. In this case, storageof a task will need less memory. This can be interesting if youhave to store lots of objects in this list. |
HashedMemoryTaskList | public HashedMemoryTaskList(boolean sequentialAccess, int initialCapacity)(Code) | | Constructor with sequentialAccess-flag and initialCapacity.
Parameters: sequentialAccess - can be set to false if the removeFirst Parameters: initial - capacity (expected document count)and elementAt methods are not used. In this case, storageof a task will need less memory. This can be interesting if youhave to store lots of objects in this list. |
add | public synchronized void add(RobotTask task)(Code) | | Add a task to the end of the list
Parameters: task - a RobotTask object to store in the queue |
addAtStart | public synchronized void addAtStart(RobotTask task)(Code) | | Add a task at the beginning of list
Parameters: task - a RobotTask object to store in the queue |
clear | public synchronized void clear()(Code) | | Clean up the list, remove all objects
|
contains | public synchronized boolean contains(RobotTask task)(Code) | | Is this robot task stored in the list ?
|
remove | public synchronized boolean remove(RobotTask task)(Code) | | Remove this object from the list
|
size | public synchronized int size()(Code) | | Returns the number of elements in this list
|
|
|