Last change
on this file since 905 was
766,
checked in by sherbold, 12 years ago
|
|
-
Property svn:mime-type set to
text/plain
|
File size:
1.3 KB
|
Line | |
---|
1 | package de.ugoe.cs.quest.plugin.guitar.commands;
|
---|
2 |
|
---|
3 | import java.util.List;
|
---|
4 |
|
---|
5 | import de.ugoe.cs.quest.plugin.guitar.EFGModelGenerator;
|
---|
6 | import de.ugoe.cs.quest.usageprofiles.DeterministicFiniteAutomaton;
|
---|
7 | import de.ugoe.cs.util.console.Command;
|
---|
8 | import de.ugoe.cs.util.console.GlobalDataContainer;
|
---|
9 |
|
---|
10 | /**
|
---|
11 | * <p>
|
---|
12 | * Command to that loads an EFG and creates Deterministic Finite Automaton (DFA)
|
---|
13 | * with the same structure.
|
---|
14 | * </p>
|
---|
15 | *
|
---|
16 | * @author Steffen Herbold
|
---|
17 | * @version 1.0
|
---|
18 | */
|
---|
19 | public class CMDefgToDFA implements Command {
|
---|
20 |
|
---|
21 | /*
|
---|
22 | * (non-Javadoc)
|
---|
23 | *
|
---|
24 | * @see de.ugoe.cs.util.console.Command#run(java.util.List)
|
---|
25 | */
|
---|
26 | @Override
|
---|
27 | public void run(List<Object> parameters) {
|
---|
28 | String filename;
|
---|
29 | String modelname;
|
---|
30 | try {
|
---|
31 | filename = (String) parameters.get(0);
|
---|
32 | modelname = (String) parameters.get(1);
|
---|
33 | } catch (Exception e) {
|
---|
34 | throw new IllegalArgumentException();
|
---|
35 | }
|
---|
36 |
|
---|
37 | EFGModelGenerator modelGenerator = new EFGModelGenerator();
|
---|
38 | DeterministicFiniteAutomaton model = modelGenerator
|
---|
39 | .efgToDeterministicFiniteAutomaton(filename);
|
---|
40 | GlobalDataContainer.getInstance().addData(modelname, model);
|
---|
41 | }
|
---|
42 |
|
---|
43 | /*
|
---|
44 | * (non-Javadoc)
|
---|
45 | *
|
---|
46 | * @see de.ugoe.cs.util.console.Command#help()
|
---|
47 | */
|
---|
48 | @Override
|
---|
49 | public String help() {
|
---|
50 | return "efgToDFA <filename> <modelname>";
|
---|
51 | }
|
---|
52 |
|
---|
53 | }
|
---|
Note: See
TracBrowser
for help on using the repository browser.