From 6c307cc6dfb8088281c1432814068f472d0a03d4 Mon Sep 17 00:00:00 2001 From: bculkin2442 Date: Tue, 11 Apr 2017 21:57:48 -0400 Subject: Cleanup --- .../java/bjc/inflexion/nouns/Prepositions.java | 24 ++++++++++++---------- 1 file changed, 13 insertions(+), 11 deletions(-) (limited to 'src/main/java/bjc/inflexion/nouns/Prepositions.java') diff --git a/src/main/java/bjc/inflexion/nouns/Prepositions.java b/src/main/java/bjc/inflexion/nouns/Prepositions.java index 356aa1c..9f8424e 100644 --- a/src/main/java/bjc/inflexion/nouns/Prepositions.java +++ b/src/main/java/bjc/inflexion/nouns/Prepositions.java @@ -22,12 +22,12 @@ import java.util.Set; /** * List of prepositions. - * + * * @author EVE * */ public class Prepositions { - private Set prepositions; + private final Set prepositions; /** * Create an empty preposition DB. @@ -38,31 +38,33 @@ public class Prepositions { /** * Check if a word is a preposition. - * + * * @param word * The word as a preposition. - * + * * @return Whether or not the word is a preposition. */ - public boolean isPreposition(String word) { + public boolean isPreposition(final String word) { return prepositions.contains(word); } /** * Load the contents of the stream into this DB. - * + * * @param stream * The stream to load from. */ - public void loadFromStream(InputStream stream) { - try(Scanner scn = new Scanner(stream)) { - while(scn.hasNextLine()) { - String ln = scn.nextLine().trim(); + public void loadFromStream(final InputStream stream) { + try (Scanner scn = new Scanner(stream)) { + while (scn.hasNextLine()) { + final String ln = scn.nextLine().trim(); /* * Ignore comments */ - if(ln.startsWith("#")) continue; + if (ln.startsWith("#")) { + continue; + } prepositions.add(ln); } -- cgit v1.2.3