public void specificArc(CommandXPathPlus command) throws ParserConfigurationException, SAXException, IOException, SQLException, ClassNotFoundException { if (this.filePrint) { this.context.addResult("Using file " + command.getFile()); this.context.addResult(""); } Expansor expansor = this.getDTS(command); Vector<Arc> documentArcs = new Vector<Arc>(); Vector<Arc> filteredArcs = new Vector<Arc>(); for (int i = 0; documentSet.size() > i; i++) { documentArcs.clear(); filteredArcs.clear(); if (this.filePrint) this.context.addResult( "Arcs from " + ((XmlDocument) documentSet.get(i)).getDocumentName() + ": "); documentArcs = ((XmlDocument) documentSet.get(i)) .getArcs( expansor.getInicialDocument( this.startpoint == null ? StartPoint.INSTANCE : this.startpoint.getBase())); filteredArcs = expansor.getFilteredArcs(documentArcs, this.arcsFilter); for (int j = 0; filteredArcs.size() > j; j++) { Arc arc = filteredArcs.get(j); if (arc.getLabelFrom().equalsIgnoreCase(command.getElement()) || (arc.getLabelTo().equalsIgnoreCase(command.getElement()))) { if (this.filePrint) this.context.addResult( "Exist arc between " + arc.getLabelFrom() + " (" + arc.getNodesFrom().size() + ") and " + arc.getLabelTo() + " (" + arc.getNodesTo().size() + ")"); } } if (this.filePrint) this.context.addResult(""); addArcs(filteredArcs); } }
// Todos os arcos: Gera o resultado a partir de um objeto da classe Documento, // explicitando as relacoes entre os arcos em forma de Strings public void execute(CommandAllArcs command) throws ParserConfigurationException, SAXException, IOException, SQLException, ClassNotFoundException { if (this.filePrint) { this.context.addResult("Using file " + command.getFile()); this.context.addResult(""); } Expansor expansor = this.getDTS(command); Vector<Arc> documentArcs = new Vector<Arc>(); Vector<Arc> filteredArcs = new Vector<Arc>(); for (int i = 0; documentSet.size() > i; i++) { documentArcs.clear(); filteredArcs.clear(); if (this.filePrint) this.context.addResult( "Arcs from " + ((XmlDocument) documentSet.get(i)).getDocumentName() + ": "); documentArcs = ((XmlDocument) documentSet.get(i)).getArcs(expansor.getInicialDocument(this.base)); filteredArcs = expansor.getFilteredArcs(documentArcs, this.arcsFilter); for (int j = 0; filteredArcs.size() > j; j++) { Arc arc = filteredArcs.get(j); if (this.filePrint) this.context.addResult( "Exist arc between " + arc.getLabelFrom() + " (" + arc.getNodesFrom().size() + ") and " + arc.getLabelTo() + " (" + arc.getNodesTo().size() + ")"); } if (this.filePrint) this.context.addResult(""); addArcs(filteredArcs); } }