Skip to content
Snippets Groups Projects
Commit f0f0d189 authored by @David.Mo's avatar @David.Mo
Browse files

kanskje ferdig

parent a5010a3e
No related branches found
No related tags found
No related merge requests found
......@@ -13,7 +13,7 @@ public class CmdEcho implements Command {
@Override
public String getName() {
return "echo";
return "echo";
}
}
\ No newline at end of file
......@@ -4,4 +4,4 @@ package no.uib.inf101.terminal;
public interface Command {
String run(String[] args);
String getName();
}
\ No newline at end of file
}
\ No newline at end of file
......@@ -12,7 +12,7 @@ package no.uib.inf101.terminal;
* text which can be displayed on a screen.
*/
public interface CommandLineInterface {
/**
* Called when a key is pressed.
*
......
......@@ -20,7 +20,7 @@ public class Context {
////////////////////////
// Constructors
////////////////////////
////////////////////////
/**
* Create a new context with the java current working directory as
......
......@@ -17,7 +17,7 @@ public class DummyShell implements CommandLineInterface {
} else {
screenContent += key;
}
}
}
@Override
public String getScreenContent() {
......
......@@ -21,7 +21,7 @@ public class EchoShell implements CommandLineInterface {
} else {
currentLine += key;
}
}
}
@Override
public String getScreenContent() {
......
......@@ -14,4 +14,4 @@ public class Main {
Terminal gui = new Terminal(shell);
gui.run();
}
}
\ No newline at end of file
}
\ No newline at end of file
......@@ -20,7 +20,7 @@ import java.util.HashMap;
import java.util.List;
import java.util.Objects;
public class SimpleShell implements CommandLineInterface{
//////////////////////////////////////////////////////////////////////
......
......@@ -21,7 +21,7 @@ public class Terminal extends JPanel {
////////////////////////
/** The command line interface to interact with. */
private final CommandLineInterface cli;
////////////////////////
// Constructor
////////////////////////
......
......@@ -22,7 +22,7 @@ public class TextAnswers {
* In which class is the object cli refers to?
*/
static final String q2 = "DummyShell";
/**
* Consider the following code:
* CommandLineInterface cli = new DummyShell();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment