Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow other naming strategies for jgc source #769

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,36 @@
public class CsvJointGridContainerSource {
private CsvJointGridContainerSource() {}

/**
* Reads CSV files into a {@link JointGridContainer}. Assumes a {@link
* edu.ie3.datamodel.io.naming.FlatDirectoryHierarchy}
*
* @param gridName The grid name
* @param csvSep The csv separator
* @param directoryPath The base directory path
* @return The JointGridContainer
* @throws SourceException in case something went wrong
*/
public static JointGridContainer read(String gridName, String csvSep, String directoryPath)
throws SourceException {

/* Parameterization */
FileNamingStrategy fileNamingStrategy = new FileNamingStrategy();
return read(gridName, csvSep, directoryPath, fileNamingStrategy);
}

FileNamingStrategy namingStrategy = new FileNamingStrategy(); // Default naming strategy
/**
* Reads CSV files into a JointGridContainer.
*
* @param gridName The grid name
* @param csvSep The csv separator
* @param directoryPath The base directory path
* @param namingStrategy The naming strategy
* @return The JointGridContainer
* @throws SourceException in case something went wrong
*/
public static JointGridContainer read(
String gridName, String csvSep, String directoryPath, FileNamingStrategy namingStrategy)
throws SourceException {

/* Instantiating sources */
TypeSource typeSource = new CsvTypeSource(csvSep, directoryPath, namingStrategy);
Expand Down