Statistics
| Revision:

root / branches / v2_0_0_prep / libraries / libTools / src / org / gvsig / tools / exception / BaseExceptionIterator.java @ 23150

History | View | Annotate | Download (775 Bytes)

1
package org.gvsig.tools.exception;
2

    
3
import java.util.Iterator;
4

    
5
class BaseExceptionIterator implements Iterator {
6
        
7
        Exception exception;
8
        
9
        BaseExceptionIterator(BaseException exception){
10
                this.exception = exception;
11
        }
12
        /** 
13
         *  @return true if the iteration has more elements.
14
         */
15
        public boolean hasNext() {
16
                return this.exception != null;
17
        }
18
        
19
        /** 
20
         *  @return The next element in the iteration.
21
         */
22
        public Object next() {
23
                Exception exception;
24
                exception = this.exception;
25
                this.exception = (Exception) exception.getCause();
26
                return exception;
27
        }
28
        
29
        /** 
30
         *  @throws "UnsupportedOperationException" because
31
         *  the remove operation will not be supported
32
         *  by this Iterator.
33
         */
34
        public void remove() {
35
                throw new UnsupportedOperationException();
36
        }
37
}