Search in sources :

Example 1 with Imports

use of com.twosigma.beakerx.kernel.Imports in project beakerx by twosigma.

the class BaseEvaluator method initImports.

private void initImports(Map<String, Object> params) {
    Collection<String> listOfImports = (Collection<String>) params.get(DefaultJVMVariables.IMPORTS);
    List<ImportPath> importPaths = new ArrayList<>();
    if (listOfImports != null) {
        for (String line : listOfImports) {
            if (!line.trim().isEmpty()) {
                importPaths.add(new ImportPath(line));
            }
        }
        if (this.imports != null) {
            importPaths.addAll(this.imports.getImportPaths());
        }
    }
    this.imports = new Imports(importPaths);
}
Also used : ImportPath(com.twosigma.beakerx.kernel.ImportPath) ArrayList(java.util.ArrayList) Collection(java.util.Collection) Imports(com.twosigma.beakerx.kernel.Imports)

Aggregations

ImportPath (com.twosigma.beakerx.kernel.ImportPath)1 Imports (com.twosigma.beakerx.kernel.Imports)1 ArrayList (java.util.ArrayList)1 Collection (java.util.Collection)1