KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > commons > collections > BufferUnderflowException


1 /*
2  * Copyright 2002-2004 The Apache Software Foundation
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16 package org.apache.commons.collections;
17
18 import java.util.NoSuchElementException JavaDoc;
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.11 $ $Date: 2004/02/18 01:15:42 $
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 JavaDoc {
35     
36     /** The root cause throwable */
37     private final Throwable JavaDoc 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 JavaDoc 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 JavaDoc message, Throwable JavaDoc 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 JavaDoc getCause() {
73         return throwable;
74     }
75     
76 }
77
Popular Tags