01: /*
02: * Primitive Collections for Java.
03: * Copyright (C) 2003 Søren Bak
04: *
05: * This library is free software; you can redistribute it and/or
06: * modify it under the terms of the GNU Lesser General Public
07: * License as published by the Free Software Foundation; either
08: * version 2.1 of the License, or (at your option) any later version.
09: *
10: * This library is distributed in the hope that it will be useful,
11: * but WITHOUT ANY WARRANTY; without even the implied warranty of
12: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13: * Lesser General Public License for more details.
14: *
15: * You should have received a copy of the GNU Lesser General Public
16: * License along with this library; if not, write to the Free Software
17: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18: */
19: package bak.pcj.list;
20:
21: import java.util.LinkedList; // Workaround for bug in Javadoc 1.3.
22:
23: /**
24: * This interface represents deques of long values. Deques are lists
25: * that have specialized (and efficient) methods for adding and
26: * removing elements from the beginning and end.
27: *
28: * @see java.util.LinkedList
29: * @see LongStack
30: *
31: * @author Søren Bak
32: * @version 1.1 2003/15/2
33: * @since 1.0
34: */
35: public interface LongDeque extends LongList {
36:
37: /**
38: * Returns the first element of this deque.
39: *
40: * @return the first element of this deque.
41: *
42: * @throws IndexOutOfBoundsException
43: * if this deque is empty.
44: */
45: long getFirst();
46:
47: /**
48: * Returns the last element of this deque.
49: *
50: * @return the first element of this deque.
51: *
52: * @throws IndexOutOfBoundsException
53: * if this deque is empty.
54: */
55: long getLast();
56:
57: /**
58: * Removes the first element of this deque.
59: *
60: * @return the element that was removed.
61: *
62: * @throws IndexOutOfBoundsException
63: * if this deque is empty.
64: */
65: long removeFirst();
66:
67: /**
68: * Removes the last element of this deque.
69: *
70: * @return the element that was removed.
71: *
72: * @throws IndexOutOfBoundsException
73: * if this deque is empty.
74: */
75: long removeLast();
76:
77: /**
78: * Adds an element to the beginning of this deque.
79: *
80: * @param v
81: * the element to add to this deque.
82: */
83: void addFirst(long v);
84:
85: /**
86: * Adds an element to the end of this deque.
87: *
88: * @param v
89: * the element to add to this deque.
90: */
91: void addLast(long v);
92:
93: }
|