View Javadoc

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 net.sf.collections15;
17  
18  /***
19   * The <code>BufferOverflowException</code> is used when the buffer's capacity
20   * has been exceeded.
21   *
22   * @since Commons Collections 2.1
23   * @version $Revision: 1.1 $ $Date: 2005/03/19 07:13:35 $
24   * 
25   * @author Avalon
26   * @author <a href="mailto:bloritsch@apache.org">Berin Loritsch</a>
27   * @author <a href="mailto:jefft@apache.org">Jeff Turner</a>
28   * @author Paul Jack
29   * @author Stephen Colebourne
30   */
31  public class BufferOverflowException extends RuntimeException {
32      
33      /*** The root cause throwable */
34      private final Throwable throwable;
35  
36      /***
37       * Constructs a new <code>BufferOverflowException</code>.
38       */
39      public BufferOverflowException() {
40          super();
41          throwable = null;
42      }
43  
44      /*** 
45       * Construct a new <code>BufferOverflowException</code>.
46       * 
47       * @param message  the detail message for this exception
48       */
49      public BufferOverflowException(String message) {
50          this(message, null);
51      }
52  
53      /*** 
54       * Construct a new <code>BufferOverflowException</code>.
55       * 
56       * @param message  the detail message for this exception
57       * @param exception  the root cause of the exception
58       */
59      public BufferOverflowException(String message, Throwable exception) {
60          super(message);
61          throwable = exception;
62      }
63  
64      /***
65       * Gets the root cause of the exception.
66       *
67       * @return the root cause
68       */
69      public final Throwable getCause() {
70          return throwable;
71      }
72      
73  }