Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
Expressions
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Johannes Schöneberger
Expressions
Commits
a6cd0fbc
Commit
a6cd0fbc
authored
6 years ago
by
Sebastian Wack
Browse files
Options
Downloads
Patches
Plain Diff
Added print() to Interface and renamed VarExpression to ConstExpression
parent
8d698c1e
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/root/ConstExpression.java
+7
-2
7 additions, 2 deletions
src/root/ConstExpression.java
src/root/Expression.java
+7
-0
7 additions, 0 deletions
src/root/Expression.java
with
14 additions
and
2 deletions
src/root/
Var
Expression.java
→
src/root/
Const
Expression.java
+
7
−
2
View file @
a6cd0fbc
...
...
@@ -3,10 +3,10 @@ package root;
/**
* Diese Klasse repräsentiert eine Konstante in einer Formel.
*/
public
class
Var
Expression
implements
Expression
{
public
class
Const
Expression
implements
Expression
{
private
int
value
;
public
Var
Expression
(
int
value
)
{
public
Const
Expression
(
int
value
)
{
this
.
value
=
value
;
}
...
...
@@ -40,4 +40,9 @@ public class VarExpression implements Expression {
return
false
;
}
@Override
public
void
print
()
{
System
.
out
.
println
(
this
.
toString
());
}
}
This diff is collapsed.
Click to expand it.
src/root/Expression.java
+
7
−
0
View file @
a6cd0fbc
...
...
@@ -14,5 +14,12 @@ public interface Expression {
* @return Wert des ausgewerteten Ausdrucks
*/
public
int
eval
();
/**
* Diese Methode soll den vollständigen Ausdruck auf der Kommandozeile
* ausgeben. Beachte, dass diese Methode von allen Unterklassen genutzt
* werden kann.
*/
public
void
print
();
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment