private ModelSwitch getSwitch(Element ele) { int x = getIntValue(ele, "x"); int y = getIntValue(ele, "y"); ModelSwitch mSwitch = new ModelSwitch(new Point(x, y)); mSwitch.setCurrentDir(getIntValue(ele, "currentdirection")); NodeList nl = ele.getElementsByTagName("direction"); if (nl != null && nl.getLength() > 0) { for (int i = 0; i < nl.getLength(); ++i) { Element el = (Element) nl.item(i); mSwitch.addDirection(string2Direction(el.getFirstChild().getNodeValue())); } } return mSwitch; }
/** * Creates an adapter for the <code>target</code>. * <!-- begin-user-doc --> * <!-- end-user-doc --> * * @param target the object to adapt. * @return the adapter for the <code>target</code>. * @generated */ public Adapter createAdapter(Notifier target) { return modelSwitch.doSwitch((EObject) target); }