1 /***
2 * Queue.java
3 *
4 * Project: Dependency Tool
5 *
6 * WHEN WHO WHAT
7 * 06.06.2003 pko initial public release
8 * 22.05.2002 ctr creation
9 *
10 * Copyright 2003 ELCA Informatique SA
11 * Av. de la Harpe 22-24, 1000 Lausanne 13, Switzerland
12 * www.elca.ch
13 *
14 * This library is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU Lesser General Public License
16 * as published by the Free Software Foundation; either version 2.1 of
17 * the License, or (at your option) any later version.
18 *
19 * This library is distributed in the hope that it will be useful, but
20 * WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
22 * Lesser General Public License for more details.
23 *
24 * You should have received a copy of the GNU Lesser General Public
25 * License along with this library; if not, write to the Free Software
26 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
27 * USA
28 */
29
30 package ch.elca.dependency.util;
31
32 import ch.elca.dependency.exception.QueueEmptyException;
33 import ch.elca.dependency.exception.QueueFullException;
34
35 /***
36 * Definition of the standard <code>Queue</code> interface.
37 *
38 * @author Christoph Trutmann
39 * @version 1.0-beta
40 */
41 public interface Queue {
42
43 /***
44 * Insert object o at the rear of the queue.
45 *
46 * @param o Object to be inserted at the rear of the queue.
47 * @throws QueueFullException If the queue is full.
48 */
49 void enqueue(Object o) throws QueueFullException;
50
51 /***
52 * Remove and return from the queue the object at the front.
53 *
54 * @return Object removed from the front of the queue.
55 * @throws QueueEmptyException If the queue is empty.
56 */
57 Object dequeue() throws QueueEmptyException;
58
59 /***
60 * Return the number of objects in the queue.
61 *
62 * @return Number of objects in the queue.
63 */
64 int size();
65
66 /***
67 * Return a boolean value that indicates whether the queue is empty.
68 *
69 * @return True if the queue is empty.
70 */
71 boolean isEmpty();
72
73 /***
74 * Return, but do not remove, the front object in the queue. An error occurs
75 * if the qeue is empty.
76 *
77 * @return Object in front of the queue.
78 * @throws QueueEmptyException If the queue is empty.
79 */
80 Object front() throws QueueEmptyException;
81 }
This page was automatically generated by Maven