public void startElement(String namespaceURI, String localName, String qName, Attributes atts) { // first clear the character buffer m_sbuf.delete(0, m_sbuf.length()); if (qName.equals(GRAPH)) { // parse directedness default String edef = atts.getValue(EDGEDEF); m_directed = DIRECTED.equalsIgnoreCase(edef); m_graphid = atts.getValue(ID); } else if (qName.equals(KEY)) { if (!inSchema) { error( "\"" + KEY + "\" elements can not" + " occur after the first node or edge declaration."); } m_for = atts.getValue(FOR); m_id = atts.getValue(ID); m_name = atts.getValue(ATTRNAME); m_type = atts.getValue(ATTRTYPE); } else if (qName.equals(NODE)) { schemaCheck(); m_row = m_nodes.addRow(); String id = atts.getValue(ID); m_nodeMap.put(id, new Integer(m_row)); m_table = m_nodes; } else if (qName.equals(EDGE)) { schemaCheck(); m_row = m_edges.addRow(); // do not use the id value // String id = atts.getValue(ID); // if ( id != null ) { // if ( !m_edges.canGetString(ID) ) // m_edges.addColumn(ID, String.class); // m_edges.setString(m_row, ID, id); // } m_edges.setString(m_row, SRCID, atts.getValue(SRC)); m_edges.setString(m_row, TRGID, atts.getValue(TRG)); // currently only global directedness is used // ignore directed edge value for now // String dir = atts.getValue(DIRECTED); // boolean d = m_directed; // if ( dir != null ) { // d = dir.equalsIgnoreCase("false"); // } // m_edges.setBoolean(m_row, DIRECTED, d); m_table = m_edges; } else if (qName.equals(DATA)) { m_key = atts.getValue(KEY); } }
private boolean isValidRequest(PlanningTask parameters) { PlanningAlgorithm algorithm = parameters.getAlgorithm(); PlanningAlgorithmsSpecification algorithmSpecification = PlanningAlgorithmsSpecification.getAlgorithmSpecification(algorithm); Graph graph = parameters.getGraph().getGraph(); return !((DIRECTED.equals(graph.getDefaultedgetype()) && !algorithmSpecification.supportsDirectedGraph()) || (isWeightedGraph(graph) && !algorithmSpecification.supportsWeightedGraph())); }