Interface Formattable<T>

Type Parameters:
T - the type of records
All Superinterfaces:
Displayable
All Known Implementing Classes:
AdaptiveGridArchive, Analyzer.AnalyzerResults, DefaultEpsilons, EpsilonBoxDominanceArchive, FitnessBasedArchive, FutureSolution, Indicators.IndicatorValues, MSOPSRankedPopulation, NondominatedPopulation, NondominatedSortingPopulation, Observations, Population, ReferencePointNondominatedSortingPopulation, ReferenceVectorGuidedPopulation, Solution, Timer, TypedProperties

public interface Formattable<T> extends Displayable
Interface used by classes containing tabular data (think like a spreadsheet) that can be formatted and rendered in various ways.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the contents of this object as a TabularData instance, which can be used to save, print, or format the data in various ways.
    default void
    Displays the contents of this object to the given output stream.
    default void
    display(TableFormat tableFormat)
    Displays the data in the given format to the terminal.
    default void
    display(TableFormat tableFormat, PrintStream out)
    Displays the data in the given format.
    default void
    save(TableFormat tableFormat, File file)
    Saves the data to a file in the requested format.
    default void
    saveCSV(File file)
    Saves the contents of this object to a CSV file.

    Methods inherited from interface org.moeaframework.util.format.Displayable

    display
  • Method Details

    • asTabularData

      TabularData<T> asTabularData()
      Returns the contents of this object as a TabularData instance, which can be used to save, print, or format the data in various ways.
      Returns:
      the TabularData instance
    • display

      default void display(PrintStream out)
      Description copied from interface: Displayable
      Displays the contents of this object to the given output stream. This method does not close the underlying stream; the caller is responsible for disposing it.
      Specified by:
      display in interface Displayable
      Parameters:
      out - the output stream
    • display

      default void display(TableFormat tableFormat)
      Displays the data in the given format to the terminal.
      Parameters:
      tableFormat - the table format
    • display

      default void display(TableFormat tableFormat, PrintStream out)
      Displays the data in the given format.
      Parameters:
      tableFormat - the table format
      out - the output stream
    • save

      default void save(TableFormat tableFormat, File file) throws IOException
      Saves the data to a file in the requested format.
      Parameters:
      tableFormat - the resulting table format
      file - the resulting file
      Throws:
      IOException - if an I/O error occurred while writing the file
    • saveCSV

      default void saveCSV(File file) throws IOException
      Saves the contents of this object to a CSV file.
      Parameters:
      file - the resulting file
      Throws:
      IOException - if an I/O error occurred while writing the file