Class Column<T,V>

java.lang.Object
org.moeaframework.util.format.Column<T,V>
Type Parameters:
T - the type for each record (row)
V - the type of value in this column

public class Column<T,V> extends Object
Defines a column in a TabularData instance.
  • Constructor Details

    • Column

      public Column(String name, Function<T,V> supplier)
      Creates a new column.
      Parameters:
      name - the name of this column
      supplier - function to read the value from each record
  • Method Details

    • getCustomFormatter

      public Formatter<V> getCustomFormatter()
      Gets the custom formatter assigned to this column.
      Returns:
      the custom formatter or null if none is assigned
    • setCustomFormatter

      public void setCustomFormatter(Formatter<V> customFormatter)
      Sets a custom formatter used to display strings. If none is set, the default formatting is used.
      Parameters:
      customFormatter - the custom formatter
    • getName

      public String getName()
      The name of this column. This may be displayed as the column header depending on the output format.
      Returns:
      the name of this column
    • getValue

      public V getValue(T row)
      Reads the value of this column from the given record (row).
      Parameters:
      row - the record
      Returns:
      the value of this column