diff --git a/pom.xml b/pom.xml index e6f5cd07a440f6ca9e524741bf01214377c82f0e..15530b78e2451b973d0add15c10c408e7ec434fd 100644 --- a/pom.xml +++ b/pom.xml @@ -19,9 +19,29 @@ <target>8</target> </configuration> </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-javadoc-plugin</artifactId> + <version>3.1.1</version> + <configuration> + <source>8</source> + </configuration> + </plugin> </plugins> </build> +<!-- + <reporting> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-javadoc-plugin</artifactId> + <version>3.1.1</version> + </plugin> + </plugins> + </reporting> +--> + <dependencies> <dependency> <groupId>junit</groupId> @@ -29,6 +49,13 @@ <version>4.12</version> <scope>test</scope> </dependency> + <!-- https://mvnrepository.com/artifact/org.apache.maven.plugins/maven-javadoc-plugin --> + <dependency> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-javadoc-plugin</artifactId> + <version>3.1.1</version> + </dependency> + <dependency> <groupId>com.vdurmont</groupId> <artifactId>emoji-java</artifactId> diff --git a/src/main/java/edu/unl/cse/bohn/StringBox.java b/src/main/java/edu/unl/cse/bohn/StringBox.java index baa0d8ad246647eeebd7a706bfbb9aab0ce62f7a..d0d3d2849b12020425a351b744db04278c547f33 100644 --- a/src/main/java/edu/unl/cse/bohn/StringBox.java +++ b/src/main/java/edu/unl/cse/bohn/StringBox.java @@ -55,19 +55,22 @@ public class StringBox { * printed with <code>System.out.print()</code> then it will leave the cursor at the end of the last line without * scrolling the top of the string off of the screen. This particular style would be useful if you place the * prompt on the last line.</p> + * + * @param boxHeight the number of rows in this StringBox + * @param boxWidth the number of columns in this StringBox */ - public StringBox(int maximumHeight, int maximumWidth) { - if (maximumHeight > 0 && maximumWidth > 0) { - this.maximumHeight = maximumHeight; - this.maximumWidth = maximumWidth; - rows = new StringRow[maximumHeight]; - for (int i = 0; i < maximumHeight; i++) { - rows[i] = new StringRow(maximumWidth); + public StringBox(int boxHeight, int boxWidth) { + if (boxHeight > 0 && boxWidth > 0) { + this.maximumHeight = boxHeight; + this.maximumWidth = boxWidth; + rows = new StringRow[boxHeight]; + for (int i = 0; i < boxHeight; i++) { + rows[i] = new StringRow(boxWidth); } logicalHeight = 0; } else { throw new IllegalArgumentException("String Box must be at least 1 character wide by 1 character tall. " + - "Dimensions " + maximumWidth + "×" + maximumHeight + " are too small."); + "Dimensions " + boxWidth + "×" + boxHeight + " are too small."); } }