@return the specified index in the list
(int i)
| 224 | * @return the specified index in the list |
| 225 | */ |
| 226 | public TemplateModel get(int i) throws TemplateModelException { |
| 227 | try { |
| 228 | Object value = list.get(i); |
| 229 | if (value instanceof TemplateModel) { |
| 230 | return (TemplateModel) value; |
| 231 | } |
| 232 | TemplateModel tm = wrap(value); |
| 233 | list.set(i, tm); |
| 234 | return tm; |
| 235 | } |
| 236 | catch(IndexOutOfBoundsException e) { |
| 237 | return null; |
| 238 | // throw new TemplateModelException(i + " out of bounds [0, " + list.size() + ")"); |
| 239 | } |
| 240 | } |
| 241 | |
| 242 | public int size() { |
| 243 | return list.size(); |