1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package net.sf.collections15;
17
18 import java.util.NoSuchElementException;
19
20 /***
21 * The BufferUnderflowException is used when the buffer is already empty.
22 * <p>
23 * NOTE: From version 3.0, this exception extends NoSuchElementException.
24 *
25 * @since Commons Collections 2.1
26 * @version $Revision: 1.1 $ $Date: 2005/03/19 07:13:35 $
27 *
28 * @author Avalon
29 * @author Berin Loritsch
30 * @author Jeff Turner
31 * @author Paul Jack
32 * @author Stephen Colebourne
33 */
34 public class BufferUnderflowException extends NoSuchElementException {
35
36 /*** The root cause throwable */
37 private final Throwable throwable;
38
39 /***
40 * Constructs a new <code>BufferUnderflowException</code>.
41 */
42 public BufferUnderflowException() {
43 super();
44 throwable = null;
45 }
46
47 /***
48 * Construct a new <code>BufferUnderflowException</code>.
49 *
50 * @param message the detail message for this exception
51 */
52 public BufferUnderflowException(String message) {
53 this(message, null);
54 }
55
56 /***
57 * Construct a new <code>BufferUnderflowException</code>.
58 *
59 * @param message the detail message for this exception
60 * @param exception the root cause of the exception
61 */
62 public BufferUnderflowException(String message, Throwable exception) {
63 super(message);
64 throwable = exception;
65 }
66
67 /***
68 * Gets the root cause of the exception.
69 *
70 * @return the root cause
71 */
72 public final Throwable getCause() {
73 return throwable;
74 }
75
76 }