Skip to content
Snippets Groups Projects
Commit 2255f5e9 authored by Goik Martin's avatar Goik Martin
Browse files

Lexicographcally --> alphabetically

parent 1dd5cfcf
Branches
No related tags found
No related merge requests found
......@@ -6,8 +6,8 @@ package de.hdm_stuttgart.mi.sd1.task1;
public class HelperArray {
/**
* <p>Filter an array of strings creating a new array containing only non-<code>null</code>values being
* lexicographically larger than a given reference string. The original array will be left untouched.</p>
* <p>Filter an array of strings creating a new array containing only those non-<code>null</code> values
* following a given reference string. The original array will be left untouched.</p>
*
* <p>Examples starting from <code>{"brown", "red", "yellow", "green"}</code>:</p>
*
......@@ -20,14 +20,14 @@ public class HelperArray {
* <tr>
* <td><code>"magenta"</code></td>
* <td><code>{"red", "yellow"}</code></td>
* <td>Both <code>"brown"</code> and <code>"green"</code> being lexicographically smaller than "magenta"
* <td>Both <code>"brown"</code> and <code>"green"</code> precede "magenta" (alphabetically).
* get evicted.</td>
* </tr>
*
* <tr>
* <td><code>"red"</code></td>
* <td><code>{"yellow"}</code></td>
* <td>All values except <code>{"yellow"}</code> are lexicographically smaller than <code>"red"</code>.</td>
* <td>All values except <code>{"yellow"}</code> precede <code>"red"</code>.</td>
* </tr>
*
* </table>
......@@ -42,10 +42,10 @@ public class HelperArray {
*
* </section>
*
* @param values {@link String} or <code>null</code> values.
* @param values {@link String} or <code>null</code> values remaining untouched.
* @param reference A reference string defining a filter.
* @return A new array containing all original non-<code>null</code> elements being lexicographically larger than the
* reference string. If either argument is null an empty array will be returned.
* @return A possibly empty new array containing only those non-<code>null</code> values following the
* reference string in alphabetical order. If either argument is null the result will be empty.
*
*/
static public String[] getAlphabeticalFollowers(final String[] values, final String reference) {
......
......@@ -8,8 +8,8 @@ import java.util.Arrays;
public class HelperArray {
/**
* <p>Filter an array of strings creating a new array containing only non-<code>null</code>values being
* lexicographically larger than a given reference string. The original array will be left untouched.</p>
* <p>Filter an array of strings creating a new array containing only those non-<code>null</code> values
* following a given reference string. The original array will be left untouched.</p>
*
* <p>Examples starting from <code>{"brown", "red", "yellow", "green"}</code>:</p>
*
......@@ -22,14 +22,14 @@ public class HelperArray {
* <tr>
* <td><code>"magenta"</code></td>
* <td><code>{"red", "yellow"}</code></td>
* <td>Both <code>"brown"</code> and <code>"green"</code> being lexicographically smaller than "magenta"
* <td>Both <code>"brown"</code> and <code>"green"</code> precede "magenta" (alphabetically).
* get evicted.</td>
* </tr>
*
* <tr>
* <td><code>"red"</code></td>
* <td><code>{"yellow"}</code></td>
* <td>All values except <code>{"yellow"}</code> are lexicographically smaller than <code>"red"</code>.</td>
* <td>All values except <code>{"yellow"}</code> precede <code>"red"</code>.</td>
* </tr>
*
* </table>
......@@ -44,10 +44,10 @@ public class HelperArray {
*
* </section>
*
* @param values {@link String} or <code>null</code> values.
* @param values {@link String} or <code>null</code> values remaining untouched.
* @param reference A reference string defining a filter.
* @return A new array containing all original non-<code>null</code> elements being lexicographically larger than the
* reference string. If either argument is null an empty array will be returned.
* @return A possibly empty new array containing only those non-<code>null</code> values following the
* reference string in alphabetical order. If either argument is null the result will be empty.
*
*/
static public String[] getAlphabeticalFollowers(final String[] values, final String reference) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment