Esempio n. 1
0
 private void writeVertices(ValidateNETFile vmf, PrintWriter pw) {
   pw.write(MATFileProperty.HEADER_VERTICES + " " + vmf.getVertices().size() + "\n");
   for (int i = 0; i < vmf.getVertices().size(); i++) {
     NETVertex mv = (NETVertex) vmf.getVertices().get(i);
     String s = "";
     for (int j = 0; j < NETVertex.getVertexAttributes().size(); j++) {
       try {
         NETAttribute ma = (NETAttribute) NETVertex.getVertexAttributes().get(j);
         String attr = ma.getAttrName();
         String type = ma.getDataType();
         String value = mv.getAttribute(attr).toString();
         if (value == null) {
           s += "";
         } else {
           if (NETFileFunctions.isInList(attr, noPrintParameters)) {
             if (type.equalsIgnoreCase("string")) s += "\"" + mv.getAttribute(attr) + "\" ";
             else s += mv.getAttribute(attr) + " ";
           } else {
             if (type.equalsIgnoreCase("string")) {
               if (attr.startsWith("unknown")) s += " \"" + mv.getAttribute(attr) + "\" ";
               else s += attr + " \"" + mv.getAttribute(attr) + "\" ";
             } else s += attr + " " + mv.getAttribute(attr) + " ";
           }
         }
       } catch (NullPointerException ex) {
         s += "";
       }
     }
     // System.out.println(s);
     pw.println(s);
   }
   // System.out.println("done here");
 }