Examples of writeNext()


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

        final List<String> fields = scrollChunk.getFields();
        final int numberOfFields = fields.size();

        if (scrollChunk.isFirstChunk()) {
            // write field headers only on first chunk
            csvWriter.writeNext(fields.toArray(new String[numberOfFields]));
        }
        // write result set in same order as the header row
        final String[] fieldValues = new String[numberOfFields];
        for (ResultMessage message : scrollChunk.getMessages()) {
            int idx = 0;
View Full Code Here

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

                }
                idx++;
            }

            // write the complete line, some fields might not be present in the message, so there might be null values
            csvWriter.writeNext(fieldValues);
        }
        if (csvWriter.checkError()) {
            LOG.error("Encountered unspecified error when writing message result as CSV, result is likely malformed.");
        }
        csvWriter.close();
View Full Code Here

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

        final CSVWriter csvWriter = new CSVWriter(new OutputStreamWriter(entityStream, StandardCharsets.UTF_8));
        final ImmutableSortedSet<String> sortedFields = ImmutableSortedSet.copyOf(
                Iterables.concat(searchResponse.fields, Lists.newArrayList("source", "timestamp")));

        // write field headers
        csvWriter.writeNext(sortedFields.toArray(new String[sortedFields.size()]));

        // write result set in same order as the header row
        final String[] fieldValues = new String[sortedFields.size()];
        for (ResultMessage message : searchResponse.messages) {
            int idx = 0;
View Full Code Here

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

                final Object val = message.getMessage().get(fieldName);
                fieldValues[idx++] = ((val == null) ? null : val.toString().replaceAll("\n", "\\\\n"));
                fieldValues[idx++] = ((val == null) ? null : val.toString().replaceAll("\r", "\\\\r"));
            }
            // write the complete line, some fields might not be present in the message, so there might be null values
            csvWriter.writeNext(fieldValues);
        }
        if (csvWriter.checkError()) {
            LOG.error("Encountered unspecified error when writing message result as CSV, result is likely malformed.");
        }
        csvWriter.close();
View Full Code Here

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

        patternStopColumnIndex.put(patternStop.id, headerBase.length + patternStop.stopSequence);
      }
     
      String[] header = (String[]) ArrayUtils.addAll(headerBase, headerStopNames);
     
      csvWriter.writeNext(headerBase);
      csvWriter.writeNext(headerStopNames);
      csvWriter.writeNext(headerStopIds);
      csvWriter.writeNext(headerStopTravelTimes);
      csvWriter.writeNext(headerStopDwellTimes);
      csvWriter.writeNext(headerStopTravelCumulative);
View Full Code Here

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

      }
     
      String[] header = (String[]) ArrayUtils.addAll(headerBase, headerStopNames);
     
      csvWriter.writeNext(headerBase);
      csvWriter.writeNext(headerStopNames);
      csvWriter.writeNext(headerStopIds);
      csvWriter.writeNext(headerStopTravelTimes);
      csvWriter.writeNext(headerStopDwellTimes);
      csvWriter.writeNext(headerStopTravelCumulative);
     
View Full Code Here

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

     
      String[] header = (String[]) ArrayUtils.addAll(headerBase, headerStopNames);
     
      csvWriter.writeNext(headerBase);
      csvWriter.writeNext(headerStopNames);
      csvWriter.writeNext(headerStopIds);
      csvWriter.writeNext(headerStopTravelTimes);
      csvWriter.writeNext(headerStopDwellTimes);
      csvWriter.writeNext(headerStopTravelCumulative);
     
      for(Trip trip : trips)
View Full Code Here

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

      String[] header = (String[]) ArrayUtils.addAll(headerBase, headerStopNames);
     
      csvWriter.writeNext(headerBase);
      csvWriter.writeNext(headerStopNames);
      csvWriter.writeNext(headerStopIds);
      csvWriter.writeNext(headerStopTravelTimes);
      csvWriter.writeNext(headerStopDwellTimes);
      csvWriter.writeNext(headerStopTravelCumulative);
     
      for(Trip trip : trips)
      {
View Full Code Here

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

     
      csvWriter.writeNext(headerBase);
      csvWriter.writeNext(headerStopNames);
      csvWriter.writeNext(headerStopIds);
      csvWriter.writeNext(headerStopTravelTimes);
      csvWriter.writeNext(headerStopDwellTimes);
      csvWriter.writeNext(headerStopTravelCumulative);
     
      for(Trip trip : trips)
      {
        String[] tripTimes = new String[headerBase.length + stopList.size() + 1];
View Full Code Here

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

      csvWriter.writeNext(headerBase);
      csvWriter.writeNext(headerStopNames);
      csvWriter.writeNext(headerStopIds);
      csvWriter.writeNext(headerStopTravelTimes);
      csvWriter.writeNext(headerStopDwellTimes);
      csvWriter.writeNext(headerStopTravelCumulative);
     
      for(Trip trip : trips)
      {
        String[] tripTimes = new String[headerBase.length + stopList.size() + 1];
       
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.