View Javadoc

1   // AddressQueue.java, created Aug 5, 2004 12:02:14 AM by joewhaley
2   // Copyright (C) 2004 John Whaley <jwhaley@alum.mit.edu>
3   // Licensed under the terms of the GNU LGPL; see COPYING for details.
4   package joeq.Allocator;
5   
6   import joeq.Memory.Address;
7   
8   /***
9    * AddressQueue
10   * 
11   * @author John Whaley
12   * @version $Id: AddressQueue.java 1852 2004-08-05 18:35:07Z joewhaley $
13   */
14  public interface AddressQueue {
15      /***
16       * Free the memory associated with this reference queue.
17       */
18      void free();
19  
20      /***
21       * Grows the queue to the specified size in words.
22       * 
23       * @param words
24       */
25      void growQueue(int words);
26  
27      /***
28       * Return the number of elements in this queue.
29       * 
30       * @return number of elements in this queue
31       */
32      int size();
33  
34      /***
35       * Return the amount of free space (in words) in this queue.
36       * 
37       * @return amount of free space (in words) in this queue
38       */
39      int space();
40  
41      /***
42       * Add the given address to the reference queue.
43       * 
44       * @param a  address to add
45       */
46      void push(Address a);
47  
48      /***
49       * Returns and removes an address from this queue, or returns
50       * null if the queue is empty.
51       * 
52       * @return address, or null if queue is empty
53       */
54      Address pull();
55      
56      /***
57       * Returns the first address from this queue, or null if
58       * the queue is empty.
59       * 
60       * @return address, or null if queue is empty
61       */
62      Address peek();
63  }