org.decisiondeck.jmcda.persist.text
Class CsvExporter
java.lang.Object
org.decisiondeck.jmcda.persist.utils.ExportSettings
org.decisiondeck.jmcda.persist.text.CsvExporter
- All Implemented Interfaces:
- Flushable
public class CsvExporter
- extends ExportSettings
- implements Flushable
No need to close this object after use: the user has initialized the stream so let him close it after use himself.
Just don't forget to flush() after use (heh).
|
Constructor Summary |
CsvExporter(com.csvreader.CsvWriter writer)
|
CsvExporter(Writer writer)
Writes the data to the given writer, using a comma as the column delimiter. |
| Methods inherited from class org.decisiondeck.jmcda.persist.utils.ExportSettings |
getAlternativesOrder, getAlternativesToString, getAlternativeString, getCategoriesToString, getCategoryString, getCriteriaOrder, getCriteriaToString, getCriterionString, getDmsOrder, getDmsToString, getDmString, getNumberFormatter, getNumberString, getNumberString, getProfilesOrder, getProfilesToString, getProfileString, interOrderAlternatives, interOrderCriteria, interOrderDms, interOrderProfiles, setAlternativesOrder, setAlternativesToString, setCategoriesToString, setCriteriaOrder, setCriteriaToString, setDmsOrder, setDmsToString, setNumberFormatter, setProfilesOrder, setProfilesToString |
CsvExporter
public CsvExporter(com.csvreader.CsvWriter writer)
- Parameters:
writer - not null.
CsvExporter
public CsvExporter(Writer writer)
- Writes the data to the given writer, using a comma as the column delimiter.
- Parameters:
writer - The target to write the column delimited data to. Not null.
flush
public void flush()
throws IOException
- Specified by:
flush in interface Flushable
- Throws:
IOException
setDelimiter
public void setDelimiter(char delimiter)
exportAssignments
public void exportAssignments(IAssignmentsRead assignments)
throws IOException
- Throws:
IOException
exportAssignments
public static void exportAssignments(Writer writer,
IAssignmentsRead assignments)
throws IOException
- Throws:
IOException
endRecord
public void endRecord()
throws IOException
- Throws:
IOException
exportEvaluations
public static void exportEvaluations(Writer writer,
IRdEvaluations evaluations)
throws InvalidInputException,
IOException
- Throws:
InvalidInputException
IOException
exportEvaluations
public void exportEvaluations(IRdEvaluations evaluations)
throws InvalidInputException,
IOException
- Throws:
InvalidInputException
IOException
exportAlternatives
public void exportAlternatives(Set<Alternative> alternatives)
throws IOException
- Throws:
IOException
exportCriteria
public void exportCriteria(Set<Criterion> criteria)
throws IOException
- Throws:
IOException
exportCategories
public void exportCategories(Set<Category> categories)
throws IOException
- Throws:
IOException
exportDms
public void exportDms(Set<DecisionMaker> dms)
throws IOException
- Throws:
IOException
exportValues
public void exportValues(Map<Criterion,Double> values)
throws IOException
- Throws:
IOException
exportEvaluationsWithAlternatives
public void exportEvaluationsWithAlternatives(IRdEvaluations evaluations)
throws IOException,
InvalidInputException
- Exports a set of records where one record is an alternative string, then for each criterion the corresponding
evaluation value. The number of records is the number of alternatives.
- Parameters:
evaluations - not null.
- Throws:
IOException - if an error occurs while writing data to the destination stream.
InvalidInputException - iff the given set of evaluations is not complete.
write
public void write(String content)
throws IOException
- Writes another column of data to this record. Does not preserve leading and trailing whitespace in this column of
data.
- Parameters:
content - The data for the new column.
- Throws:
IOException - Thrown if an error occurs while writing data to the destination stream.
Copyright © 2011. All Rights Reserved.