-
Notifications
You must be signed in to change notification settings - Fork 0
Review #3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: review
Are you sure you want to change the base?
Review #3
Changes from all commits
96e0dd4
99e51cb
213c56b
f74a3ba
ce67631
c5cd0bc
6aefc39
4e94c75
a929e20
b4e3aa1
dc8d382
f88bbb5
15f57a6
3e900fe
b0d0113
b814f3c
33df8e5
fb5a2a7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <classpath> | ||
| <classpathentry kind="src" output="target/classes" path="src/main/java"> | ||
| <attributes> | ||
| <attribute name="optional" value="true"/> | ||
| <attribute name="maven.pomderived" value="true"/> | ||
| </attributes> | ||
| </classpathentry> | ||
| <classpathentry kind="src" output="target/test-classes" path="src/test/java"> | ||
| <attributes> | ||
| <attribute name="optional" value="true"/> | ||
| <attribute name="maven.pomderived" value="true"/> | ||
| <attribute name="test" value="true"/> | ||
| </attributes> | ||
| </classpathentry> | ||
| <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"> | ||
| <attributes> | ||
| <attribute name="maven.pomderived" value="true"/> | ||
| </attributes> | ||
| </classpathentry> | ||
| <classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER"> | ||
| <attributes> | ||
| <attribute name="maven.pomderived" value="true"/> | ||
| </attributes> | ||
| </classpathentry> | ||
| <classpathentry kind="output" path="target/classes"/> | ||
| </classpath> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| .metadata | ||
| bin/ | ||
| tmp/ | ||
| *.tmp | ||
| *.bak | ||
| *.swp | ||
| *~.nib | ||
| local.properties | ||
| .settings/ | ||
| .loadpath | ||
| .recommenders | ||
|
|
||
| # External tool builders | ||
| .externalToolBuilders/ | ||
|
|
||
| # Locally stored "Eclipse launch configurations" | ||
| *.launch | ||
|
|
||
| # PyDev specific (Python IDE for Eclipse) | ||
| *.pydevproject | ||
|
|
||
| # CDT-specific (C/C++ Development Tooling) | ||
| .cproject | ||
|
|
||
| # CDT- autotools | ||
| .autotools | ||
|
|
||
| # Java annotation processor (APT) | ||
| .factorypath | ||
|
|
||
| # PDT-specific (PHP Development Tools) | ||
| .buildpath | ||
|
|
||
| # sbteclipse plugin | ||
| .target | ||
|
|
||
| # Tern plugin | ||
| .tern-project | ||
|
|
||
| # TeXlipse plugin | ||
| .texlipse | ||
|
|
||
| # STS (Spring Tool Suite) | ||
| .springBeans | ||
|
|
||
| # Code Recommenders | ||
| .recommenders/ | ||
|
|
||
| # Annotation Processing | ||
| .apt_generated/ | ||
| .apt_generated_test/ | ||
|
|
||
| # Scala IDE specific (Scala & Java development for Eclipse) | ||
| .cache-main | ||
| .scala_dependencies | ||
| .worksheet | ||
|
|
||
| # Uncomment this line if you wish to ignore the project description file. | ||
| # Typically, this file would be tracked if it contains build/dependency configurations: | ||
| #.project | ||
| /target/ |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <projectDescription> | ||
| <name>powp-rhymers</name> | ||
| <comment></comment> | ||
| <projects> | ||
| </projects> | ||
| <buildSpec> | ||
| <buildCommand> | ||
| <name>org.eclipse.jdt.core.javabuilder</name> | ||
| <arguments> | ||
| </arguments> | ||
| </buildCommand> | ||
| <buildCommand> | ||
| <name>org.eclipse.m2e.core.maven2Builder</name> | ||
| <arguments> | ||
| </arguments> | ||
| </buildCommand> | ||
| </buildSpec> | ||
| <natures> | ||
| <nature>org.eclipse.jdt.core.javanature</nature> | ||
| <nature>org.eclipse.m2e.core.maven2Nature</nature> | ||
| </natures> | ||
| </projectDescription> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,67 @@ | ||
| package edu.kis.vh.nursery; | ||
|
|
||
| /** | ||
| * @author 240827 | ||
| * Default rhymer that works similarly to a stack. | ||
| */ | ||
| public class DefaultCountingOutRhymer { | ||
|
|
||
| public static final int NUMBER = 12; | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Wrong name. |
||
| public static final int NEGATIVE = -1; | ||
| private int[] numbers = new int[NUMBER]; | ||
|
|
||
| private int total = NEGATIVE; | ||
|
|
||
| /** | ||
| * @return How many numbers have been added to the rhymer so far. | ||
| */ | ||
| public int getTotal() { | ||
| return total; | ||
| } | ||
|
|
||
| /** | ||
| * Adds number specified in in argument to the rhymer. | ||
| * The in argument is not added if the rhymer is full. | ||
| * @param in | ||
| */ | ||
| public void countIn(int in) { | ||
| if (!isFull()) | ||
| numbers[++total] = in; | ||
| } | ||
|
|
||
| /** | ||
| * @return boolean value indicating if the rhymer is empty. | ||
| */ | ||
| public boolean isEmpty() { | ||
| return total == NEGATIVE; | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This constant should be different (separate) than the one in peekaboo and countOut methods. |
||
| } | ||
|
|
||
| /** | ||
| * @return boolean value indicating if the rhymer is full. | ||
| */ | ||
| public boolean isFull() { | ||
| return total == 11; | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Another constant. It is related to NUMBER |
||
| } | ||
|
|
||
| /** | ||
| * Returns at the top of the rhymer. | ||
| * If the rhymer is empty, NEGATIVE is returned. | ||
| * @return value at the top of the rhymer. | ||
| */ | ||
| protected int peekaboo() { | ||
| if (isEmpty()) | ||
| return NEGATIVE; | ||
| return numbers[total]; | ||
| } | ||
|
|
||
| /** | ||
| * Returns value at the top of the rhymer and removes it from the rhymer. | ||
| * If the rhymer is empty, NEGATIVE is returned. | ||
| * @return value at the top of the rhymer. | ||
| */ | ||
| public int countOut() { | ||
| if (isEmpty()) | ||
| return NEGATIVE; | ||
| return numbers[total--]; | ||
| } | ||
| } | ||
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| package edu.kis.vh.nursery; | ||
|
|
||
| public class FifoRhymer extends DefaultCountingOutRhymer { | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fifo -> FIFO |
||
|
|
||
| private DefaultCountingOutRhymer internalRhymer = new DefaultCountingOutRhymer(); | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should be final |
||
|
|
||
| @Override | ||
| public int countOut() { | ||
| while (!isEmpty()) | ||
|
|
||
| internalRhymer.countIn(super.countOut()); | ||
|
|
||
| int ret = internalRhymer.countOut(); | ||
|
|
||
| while (!internalRhymer.isEmpty()) | ||
|
|
||
| countIn(internalRhymer.countOut()); | ||
|
|
||
|
Comment on lines
+8
to
+18
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. formatting convention issues (problems with merging 'format' branch?) |
||
| return ret; | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,17 +1,18 @@ | ||
| package edu.kis.vh.nursery; | ||
|
|
||
| public class HanoiRhymer extends defaultCountingOutRhymer { | ||
| public class HanoiRhymer extends DefaultCountingOutRhymer { | ||
|
|
||
| int totalRejected = 0; | ||
| private int totalRejected = 0; | ||
|
|
||
| public int reportRejected() { | ||
| return totalRejected; | ||
| } | ||
|
|
||
| @Override | ||
| public void countIn(int in) { | ||
| if (!callCheck() && in > peekaboo()) | ||
| if (!isEmpty() && in > peekaboo()) | ||
| totalRejected++; | ||
| else | ||
| super.countIn(in); | ||
| else | ||
| super.countIn(in); | ||
| } | ||
| } | ||
| } |
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,15 +1,15 @@ | ||
| package edu.kis.vh.nursery.factory; | ||
|
|
||
| import edu.kis.vh.nursery.defaultCountingOutRhymer; | ||
| import edu.kis.vh.nursery.DefaultCountingOutRhymer; | ||
|
|
||
| public interface Rhymersfactory { | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Rhymersfactory -> RhymersFactory |
||
|
|
||
| public defaultCountingOutRhymer GetStandardRhymer(); | ||
| public DefaultCountingOutRhymer GetStandardRhymer(); | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Wrong convention. Method names should start from a lower case. |
||
|
|
||
| public defaultCountingOutRhymer GetFalseRhymer(); | ||
| public DefaultCountingOutRhymer GetFalseRhymer(); | ||
|
|
||
| public defaultCountingOutRhymer GetFIFORhymer(); | ||
| public DefaultCountingOutRhymer GetFIFORhymer(); | ||
|
|
||
| public defaultCountingOutRhymer GetHanoiRhymer(); | ||
| public DefaultCountingOutRhymer GetHanoiRhymer(); | ||
|
|
||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Commits polluted with project files (.settings, .idea, etc.).