01: /*
02: * Copyright 2002-2004 The Apache Software Foundation
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
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: /**
19: * The BufferOverflowException is used when the buffer's capacity has been
20: * exceeded.
21: *
22: * @since Commons Collections 2.1
23: * @version $Revision: 155406 $ $Date: 2005-02-26 12:55:26 +0000 (Sat, 26 Feb 2005) $
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: }
|