@Test public void testUrl() { RCSBDescriptionFactory.get("1w0p"); }
public static RCSBDescription get(InputStream stream) { NodeList data; try { data = getNodes(stream); } catch (IOException e) { printError(e); return null; } RCSBDescription description = new RCSBDescription(); Element structureIdE = null; for (int i = 0; i < data.getLength(); i++) { if (data.item(i).getNodeType() != 1) continue; structureIdE = (Element) data.item(i); if (structureIdE.getNodeName().equals("structureId")) { description.setPdbId(structureIdE.getAttribute("id")); } } data = structureIdE.getChildNodes(); Element polymerE = null; for (int i = 0; i < data.getLength(); i++) { if (data.item(i).getNodeType() != 1) continue; polymerE = (Element) data.item(i); if (polymerE.getNodeName().equals("polymer")) { RCSBPolymer polymer = makePolymer(polymerE); description.addPolymer(polymer); } } return description; }
RCSBDescriptionFactory { public static RCSBDescription get(InputStream stream) { NodeList data; try { data = getNodes(stream); } catch (IOException e) { printError(e); return null; } RCSBDescription description = new RCSBDescription(); Element structureIdE = null; for (int i = 0; i < data.getLength(); i++) { if (data.item(i).getNodeType() != 1) continue; structureIdE = (Element) data.item(i); if (structureIdE.getNodeName().equals("structureId")) { description.setPdbId(structureIdE.getAttribute("id")); } } data = structureIdE.getChildNodes(); Element polymerE = null; for (int i = 0; i < data.getLength(); i++) { if (data.item(i).getNodeType() != 1) continue; polymerE = (Element) data.item(i); if (polymerE.getNodeName().equals("polymer")) { RCSBPolymer polymer = makePolymer(polymerE); description.addPolymer(polymer); } } return description; } }
RCSBDescriptionFactory { public static RCSBDescription get(InputStream stream) { NodeList data; try { data = getNodes(stream); } catch (IOException e) { printError(e); return null; } RCSBDescription description = new RCSBDescription(); Element structureIdE = null; for (int i = 0; i < data.getLength(); i++) { if (data.item(i).getNodeType() != 1) continue; structureIdE = (Element) data.item(i); if (structureIdE.getNodeName().equals("structureId")) { description.setPdbId(structureIdE.getAttribute("id")); } } data = structureIdE.getChildNodes(); Element polymerE = null; for (int i = 0; i < data.getLength(); i++) { if (data.item(i).getNodeType() != 1) continue; polymerE = (Element) data.item(i); if (polymerE.getNodeName().equals("polymer")) { RCSBPolymer polymer = makePolymer(polymerE); description.addPolymer(polymer); } } return description; }  }
RCSBDescriptionFactory { public static RCSBDescription get(InputStream stream) { NodeList data; try { data = getNodes(stream); } catch (IOException e) { printError(e); return null; } RCSBDescription description = new RCSBDescription(); Element structureIdE = null; for (int i = 0; i < data.getLength(); i++) { if (data.item(i).getNodeType() != 1) continue; structureIdE = (Element) data.item(i); if (structureIdE.getNodeName().equals("structureId")) { description.setPdbId(structureIdE.getAttribute("id")); } } data = structureIdE.getChildNodes(); Element polymerE = null; for (int i = 0; i < data.getLength(); i++) { if (data.item(i).getNodeType() != 1) continue; polymerE = (Element) data.item(i); if (polymerE.getNodeName().equals("polymer")) { RCSBPolymer polymer = makePolymer(polymerE); description.addPolymer(polymer); } } return description; }  static RCSBDescription get(InputStream stream); static RCSBDescription get(String pdbId); static void printError(Exception e); }
RCSBDescriptionFactory { public static RCSBDescription get(InputStream stream) { NodeList data; try { data = getNodes(stream); } catch (IOException e) { printError(e); return null; } RCSBDescription description = new RCSBDescription(); Element structureIdE = null; for (int i = 0; i < data.getLength(); i++) { if (data.item(i).getNodeType() != 1) continue; structureIdE = (Element) data.item(i); if (structureIdE.getNodeName().equals("structureId")) { description.setPdbId(structureIdE.getAttribute("id")); } } data = structureIdE.getChildNodes(); Element polymerE = null; for (int i = 0; i < data.getLength(); i++) { if (data.item(i).getNodeType() != 1) continue; polymerE = (Element) data.item(i); if (polymerE.getNodeName().equals("polymer")) { RCSBPolymer polymer = makePolymer(polymerE); description.addPolymer(polymer); } } return description; }  static RCSBDescription get(InputStream stream); static RCSBDescription get(String pdbId); static void printError(Exception e);  }