-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Evolog Modules: Parsing of module definitions
- Loading branch information
1 parent
aad5520
commit fd9f6a7
Showing
12 changed files
with
254 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
alpha-api/src/main/java/at/ac/tuwien/kr/alpha/api/programs/modules/Module.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package at.ac.tuwien.kr.alpha.api.programs.modules; | ||
|
||
import at.ac.tuwien.kr.alpha.api.programs.InputProgram; | ||
import at.ac.tuwien.kr.alpha.api.programs.Predicate; | ||
|
||
import java.util.Set; | ||
|
||
public interface Module { | ||
|
||
String getName(); | ||
|
||
Predicate getInputSpec(); | ||
|
||
Set<Predicate> getOutputSpec(); | ||
|
||
InputProgram getImplementation(); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
alpha-commons/src/main/java/at/ac/tuwien/kr/alpha/commons/programs/modules/ModuleImpl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package at.ac.tuwien.kr.alpha.commons.programs.modules; | ||
|
||
import at.ac.tuwien.kr.alpha.api.programs.InputProgram; | ||
import at.ac.tuwien.kr.alpha.api.programs.Predicate; | ||
import at.ac.tuwien.kr.alpha.api.programs.modules.Module; | ||
|
||
import java.util.Set; | ||
|
||
class ModuleImpl implements Module { | ||
|
||
private final String name; | ||
private final Predicate inputSpec; | ||
private final Set<Predicate> outputSpec; | ||
private final InputProgram implementation; | ||
|
||
ModuleImpl(String name, Predicate inputSpec, Set<Predicate> outputSpec, InputProgram implementation) { | ||
this.name = name; | ||
this.inputSpec = inputSpec; | ||
this.outputSpec = outputSpec; | ||
this.implementation = implementation; | ||
} | ||
|
||
@Override | ||
public String getName() { | ||
return this.name; | ||
} | ||
|
||
@Override | ||
public Predicate getInputSpec() { | ||
return this.inputSpec; | ||
} | ||
|
||
@Override | ||
public Set<Predicate> getOutputSpec() { | ||
return this.outputSpec; | ||
} | ||
|
||
@Override | ||
public InputProgram getImplementation() { | ||
return this.implementation; | ||
} | ||
|
||
} |
19 changes: 19 additions & 0 deletions
19
alpha-commons/src/main/java/at/ac/tuwien/kr/alpha/commons/programs/modules/Modules.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package at.ac.tuwien.kr.alpha.commons.programs.modules; | ||
|
||
import at.ac.tuwien.kr.alpha.api.programs.InputProgram; | ||
import at.ac.tuwien.kr.alpha.api.programs.Predicate; | ||
import at.ac.tuwien.kr.alpha.api.programs.modules.Module; | ||
|
||
import java.util.Set; | ||
|
||
public final class Modules { | ||
|
||
private Modules() { | ||
throw new AssertionError("Cannot instantiate utility class!"); | ||
} | ||
|
||
public static Module newModule(final String name, final Predicate inputSpec, final Set<Predicate> outputSpec, final InputProgram implementation) { | ||
return new ModuleImpl(name, inputSpec, outputSpec, implementation); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.