root / branches / v2_0_0_prep / libraries / libExceptions / src / org / gvsig / exceptions / ListBaseException.java @ 23150
History | View | Annotate | Download (4.24 KB)
1 |
package org.gvsig.exceptions; |
---|---|
2 |
|
3 |
import java.util.*; |
4 |
|
5 |
/**
|
6 |
* @author Equipo de desarrollo de gvSIG
|
7 |
*
|
8 |
* @deprecated @see org.gvsig.tools.exception.ListBaseException
|
9 |
*/
|
10 |
public abstract class ListBaseException extends BaseException implements List{ |
11 |
private List exceptions = new ArrayList(); |
12 |
|
13 |
/* (non-Javadoc)
|
14 |
* @see java.util.Collection#size()
|
15 |
*/
|
16 |
public int size() { |
17 |
return this.exceptions.size(); |
18 |
} |
19 |
|
20 |
/* (non-Javadoc)
|
21 |
* @see java.util.Collection#isEmpty()
|
22 |
*/
|
23 |
public boolean isEmpty() { |
24 |
return this.exceptions.isEmpty(); |
25 |
} |
26 |
|
27 |
/* (non-Javadoc)
|
28 |
* @see java.util.Collection#contains(java.lang.Object)
|
29 |
*/
|
30 |
public boolean contains(Object arg0) { |
31 |
return this.exceptions.contains(arg0); |
32 |
} |
33 |
|
34 |
/* (non-Javadoc)
|
35 |
* @see java.util.Collection#toArray()
|
36 |
*/
|
37 |
public Object[] toArray() { |
38 |
return this.exceptions.toArray(); |
39 |
} |
40 |
|
41 |
/**
|
42 |
* @param arg0
|
43 |
* @return
|
44 |
*/
|
45 |
public Object[] toArray(Object[] arg0) { |
46 |
return this.exceptions.toArray(arg0); |
47 |
} |
48 |
|
49 |
/**
|
50 |
* @param arg0
|
51 |
* @return
|
52 |
*/
|
53 |
public boolean add(Object arg0) { |
54 |
return this.exceptions.add(arg0); |
55 |
} |
56 |
|
57 |
/* (non-Javadoc)
|
58 |
* @see java.util.Collection#remove(java.lang.Object)
|
59 |
*/
|
60 |
public boolean remove(Object arg0) { |
61 |
return this.exceptions.remove(arg0); |
62 |
} |
63 |
|
64 |
/**
|
65 |
* @param arg0
|
66 |
* @return
|
67 |
*/
|
68 |
public boolean containsAll(Collection arg0) { |
69 |
return this.exceptions.contains(arg0); |
70 |
} |
71 |
|
72 |
/**
|
73 |
* @param arg0
|
74 |
* @return
|
75 |
*/
|
76 |
public boolean addAll(Collection arg0) { |
77 |
return this.exceptions.addAll(arg0); |
78 |
} |
79 |
|
80 |
/**
|
81 |
* @param arg0
|
82 |
* @param arg1
|
83 |
* @return
|
84 |
*/
|
85 |
public boolean addAll(int arg0, Collection arg1) { |
86 |
return this.exceptions.addAll(arg0, arg1); |
87 |
} |
88 |
|
89 |
/**
|
90 |
* @param arg0
|
91 |
* @return
|
92 |
*/
|
93 |
public boolean removeAll(Collection arg0) { |
94 |
return this.exceptions.removeAll(arg0); |
95 |
} |
96 |
|
97 |
/**
|
98 |
* @param arg0
|
99 |
* @return
|
100 |
*/
|
101 |
public boolean retainAll(Collection arg0) { |
102 |
return this.exceptions.retainAll(arg0); |
103 |
} |
104 |
|
105 |
/* (non-Javadoc)
|
106 |
* @see java.util.Collection#clear()
|
107 |
*/
|
108 |
public void clear() { |
109 |
this.exceptions.clear();
|
110 |
} |
111 |
|
112 |
/* (non-Javadoc)
|
113 |
* @see java.util.List#get(int)
|
114 |
*/
|
115 |
public Object get(int arg0) { |
116 |
return this.exceptions.get(arg0); |
117 |
} |
118 |
|
119 |
/**
|
120 |
* @param arg0
|
121 |
* @param arg1
|
122 |
* @return
|
123 |
*/
|
124 |
public Object set(int arg0, Object arg1) { |
125 |
return this.exceptions.set(arg0, arg1); |
126 |
} |
127 |
|
128 |
/**
|
129 |
* @param arg0
|
130 |
* @param arg1
|
131 |
*/
|
132 |
public void add(int arg0, Object arg1) { |
133 |
this.exceptions.add(arg0, arg1);
|
134 |
} |
135 |
|
136 |
/* (non-Javadoc)
|
137 |
* @see java.util.List#remove(int)
|
138 |
*/
|
139 |
public Object remove(int arg0) { |
140 |
return this.exceptions.remove(arg0); |
141 |
} |
142 |
|
143 |
/* (non-Javadoc)
|
144 |
* @see java.util.List#indexOf(java.lang.Object)
|
145 |
*/
|
146 |
public int indexOf(Object arg0) { |
147 |
return this.exceptions.indexOf(arg0); |
148 |
} |
149 |
|
150 |
/* (non-Javadoc)
|
151 |
* @see java.util.List#lastIndexOf(java.lang.Object)
|
152 |
*/
|
153 |
public int lastIndexOf(Object arg0) { |
154 |
return this.exceptions.lastIndexOf(arg0); |
155 |
} |
156 |
|
157 |
/* (non-Javadoc)
|
158 |
* @see java.util.List#listIterator()
|
159 |
*/
|
160 |
public ListIterator listIterator() { |
161 |
return this.exceptions.listIterator(); |
162 |
} |
163 |
|
164 |
/* (non-Javadoc)
|
165 |
* @see java.util.List#listIterator(int)
|
166 |
*/
|
167 |
public ListIterator listIterator(int arg0) { |
168 |
return this.exceptions.listIterator(arg0); |
169 |
} |
170 |
|
171 |
/* (non-Javadoc)
|
172 |
* @see java.util.List#subList(int, int)
|
173 |
*/
|
174 |
public List subList(int arg0, int arg1) { |
175 |
return this.exceptions.subList(arg0, arg1); |
176 |
} |
177 |
|
178 |
/* (non-Javadoc)
|
179 |
* @see java.lang.Throwable#getMessage()
|
180 |
*/
|
181 |
public String getMessage() { |
182 |
String msg = super.getMessage(); |
183 |
Exception bex;
|
184 |
Iterator iter=this.exceptions.iterator(); |
185 |
while (iter.hasNext()) {
|
186 |
bex = (Exception) iter.next();
|
187 |
msg = msg + "\n " + bex.getMessage();
|
188 |
} |
189 |
return msg;
|
190 |
} |
191 |
|
192 |
/* (non-Javadoc)
|
193 |
* @see org.gvsig.exceptions.IBaseException#getLocalizedMessage(org.gvsig.exceptions.IExceptionTranslator, int)
|
194 |
*/
|
195 |
public String getLocalizedMessage(IExceptionTranslator exceptionTranslator, int indent) { |
196 |
String msg = super.getLocalizedMessage(exceptionTranslator, indent); |
197 |
Exception bex;
|
198 |
Iterator iter=this.exceptions.iterator(); |
199 |
while (iter.hasNext()) {
|
200 |
bex = (Exception) iter.next();
|
201 |
if( bex instanceof BaseException ) { |
202 |
msg = msg + "\n " + ((BaseException)bex).getLocalizedMessage(exceptionTranslator, indent);
|
203 |
} else {
|
204 |
msg = msg + "\n " + bex.getLocalizedMessage();
|
205 |
} |
206 |
} |
207 |
return BaseException.insertBlanksAtStart(msg,indent);
|
208 |
} |
209 |
|
210 |
} |