Package au.com.bytecode.opencsv

Examples of au.com.bytecode.opencsv.CSVWriter.writeNext()


                    .getIndexValue();
            Set<Integer> annotationIds = annotationIndex.keySet();
            for (Integer annotationId : annotationIds) {
                TableAnnotationValue value = annotationIndex.get(annotationId);

                tdvWriter.writeNext(new String[] {
                        String.valueOf(annotationId),
                        String.valueOf(value.getAnnotationDefinitionId()),
                        value.getAnnotationValue() });
                allWriter.writeNext(new String[] {
                        String.valueOf(annotationId),
View Full Code Here


            for (final Map.Entry<Integer, Set<AnnotationPair>> same : samt
                    .getStatementAnnotationPairsIndex().entrySet()) {
                Integer sid = same.getKey();

                for (AnnotationPair ap : same.getValue()) {
                    tdvWriter.writeNext(new String[] {
                            String.valueOf(sid),
                            String.valueOf(ap.getAnnotationDefinitionId()),
                            String.valueOf(ap.getAnnotationValueId()) });

                    allWriter.writeNext(new String[] {
View Full Code Here

            final List<String> nodes = pnt.getProtoNodes();
            int nodeId = 0;
            for (int i = 0, n = nodes.size(); i < n; i++) {
                String nodeidstr = String.valueOf(nodeId);
                String eqidstr = String.valueOf(eqn.get(i));
                tdvWriter.writeNext(new String[] {
                        nodeidstr,
                        nodes.get(i),
                        eqidstr });
                allWriter.writeNext(new String[] {
                        nodeidstr,
View Full Code Here

            final List<String> terms = tt.getTermValues();
            final Map<Integer, Integer> visited = pnt.getTermNodeIndex();
            for (int i = 0, n = terms.size(); i < n; i++) {
                String nodeidstr = String.valueOf(visited.get(i));
                tdvWriter.writeNext(new String[] {
                        String.valueOf(i),
                        nodeidstr });
                allWriter.writeNext(new String[] {
                        String.valueOf(i),
                        nodeidstr });
View Full Code Here

                final String rel = edge.getRel();
                final String target = String.valueOf(edge.getTarget());

                String eqIndex = edgeEq.get(i).toString();

                tdvWriter.writeNext(new String[] { ei, source, rel, target,
                        eqIndex });
                allWriter.writeNext(new String[] { ei, source, rel, target,
                        eqIndex });
            }
View Full Code Here

                final Set<Integer> stmts = edgeStmts.get(i);
                if (hasItems(stmts)) {
                    for (final Integer stmt : stmts) {
                        final String stmtstring = String.valueOf(stmt);
                        tdvWriter.writeNext(new String[] { ei, stmtstring });
                        allWriter.writeNext(new String[] { ei, stmtstring });
                    }
                }
            }
View Full Code Here

    final StringWriter writer = new StringWriter();
    final CSVWriter csv = newWriter(writer, separatorChar, quoteChar, escapeChar);

    try {
      csv.writeNext(outputFields);
      csv.close();

      return new Text(writer.toString());
    } catch (final IOException ioe) {
      throw new SerDeException(ioe);
View Full Code Here

                    CSVParser.DEFAULT_ESCAPE_CHARACTER);

            final DBConnection kcc = createKAMConnection(kamName, cfg);
            kdao = new KAMExportDAO(kcc, kamInfo.getSchemaName());
            for (KAMStoreTables1_0 kamTable : KAMStoreTables1_0.values()) {
                tabbedWriter.writeNext(new String[] { "["
                        + kamTable.getTableName() + "]" });

                // write out column headers
                // tabbedWriter.writeNext(kamTable.getOtherColumnNames());
View Full Code Here

                List<String[]> allRows = kdao.getAllRowsForTable(kamTable);

                // write data as tsv if there is any
                if (hasItems(allRows)) {
                    for (String[] row : allRows) {
                        tabbedWriter.writeNext(row);
                    }
                }
            }
        } catch (IOException e) {
            throw new PKAMSerializationFailure(kamName, e.getMessage());
View Full Code Here

    CSVWriter writer = null;
    try {
      writer = new CSVWriter(new FileWriter(fileName));
      for (String[] line : csvData) {
        writer.writeNext(line);
      }
    } finally {
      if (writer != null) {
        writer.close();
      }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.