
goal.util.datatable.DataRow Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of runtime Show documentation
Show all versions of runtime Show documentation
A system for running GOAL multi-agent systems.
The newest version!
package goal.util.datatable;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import goal.tools.logging.CsvFormatter;
/**
* Contains a row of general data. Ment as output formatter for data.
*/
public class DataRow {
private Map data;
/**
* Create new data object.
*
* @param data
* a Map with the keys Strings: the headers/column names, and
* Object the data for each column. If the order of the data is
* relevant, you should provide a map that respects the order,
* like {@link LinkedHashMap}.
*/
public DataRow(Map data) {
this.data = data;
}
/**
* @return the header data. See also {@link #dataString(Set, String)}
*/
public List columns() {
List cols = new ArrayList<>();
cols.addAll(this.data.keySet());
return cols;
}
/**
* @param name
* @return the column with the given name, or null if no such data
*/
public Object column(ColumnType col) {
return this.data.get(col);
}
/**
* @return the actual data. See also {@link #dataString(Set, String)}
*/
public List
© 2015 - 2025 Weber Informatics LLC | Privacy Policy