forked from LupusNobilis/java-org.hwo
45 lines
779 B
Java
45 lines
779 B
Java
package org.hwo.csv;
|
|
|
|
import java.util.ArrayList;
|
|
|
|
public class CSVContainer {
|
|
|
|
private ArrayList<CSVTable> tables;
|
|
private CSVTable emptyTable;
|
|
|
|
public CSVContainer(){
|
|
init();
|
|
}
|
|
|
|
private void init() {
|
|
tables = new ArrayList<>();
|
|
}
|
|
|
|
public int getTableCount() {
|
|
return this.tables.size();
|
|
}
|
|
|
|
public CSVTable getTabel(int index) {
|
|
return this.tables.get(index);
|
|
}
|
|
public void addTable(CSVTable table) {
|
|
this.tables.add(table);
|
|
}
|
|
public void removeTable(CSVTable table) {
|
|
this.tables.remove(table);
|
|
}
|
|
public void removeTable(int index) {
|
|
this.tables.remove(index);
|
|
}
|
|
|
|
public String getCSV() {
|
|
String csv = new String();
|
|
|
|
for(CSVTable t : this.tables) {
|
|
csv += t.getCSV();
|
|
csv += CSVTableRow.NULL_ROW.getCSV();
|
|
}
|
|
return csv;
|
|
}
|
|
}
|