@Override public boolean addAll(Collection<? extends MappingNode> c) { boolean result = false; Iterator<? extends MappingNode> iter = c.iterator(); MappingNode o; while(iter.hasNext()) { o = iter.next(); result |= add(o); } // while return result; } // addAll(Collection)
@Override public boolean addAll(int index, Collection<? extends MappingNode> c) { int size = nodes.size(); Iterator<? extends MappingNode> iter = c.iterator(); MappingNode o; while(iter.hasNext()) { o = iter.next(); add(index++, o); } // while return (size != nodes.size()); }// addAll(int,Collection)
/**Loads the mapping definition * @throws ResourceInstantiationException if load fails. */ public void load() throws ResourceInstantiationException,InvalidFormatException { if (null == url) { throw new ResourceInstantiationException("URL not set (null)."); } try { BufferedReader mapReader = new BomStrippingInputStreamReader((url).openStream(), ENCODING); String line; MappingNode node; while (null != (line = mapReader.readLine())) { if (0 != line.trim().length()) { node = new MappingNode(line); this.add(node); } // if } //while mapReader.close(); } catch (InvalidFormatException ife){ throw new InvalidFormatException(url,"on load"); } catch (IOException ioe) { throw new ResourceInstantiationException(ioe); } } // load();