diff --git a/src/seedu/addressbook/AddressBook.java b/src/seedu/addressbook/AddressBook.java index 5a158b67..bd7442d1 100644 --- a/src/seedu/addressbook/AddressBook.java +++ b/src/seedu/addressbook/AddressBook.java @@ -623,6 +623,32 @@ private static void showToUser(String... message) { System.out.println(LINE_PREFIX + m); } } + //Without Varargs + /*private static void showToUser(String message) { + System.out.println(LINE_PREFIX + message); + } + private static void showToUser(String message, String message2) { + System.out.println(LINE_PREFIX + message); + System.out.println(LINE_PREFIX + message2); + } + private static void showToUser(String message, String message2,String message3) { + System.out.println(LINE_PREFIX + message); + System.out.println(LINE_PREFIX + message2); + System.out.println(LINE_PREFIX + message3); + } + private static void showToUser(String message, String message2,String message3,String message4) { + System.out.println(LINE_PREFIX + message); + System.out.println(LINE_PREFIX + message2); + System.out.println(LINE_PREFIX + message3); + System.out.println(LINE_PREFIX + message4); + } + private static void showToUser(String message, String message2,String message3,String message4, String message5) { + System.out.println(LINE_PREFIX + message); + System.out.println(LINE_PREFIX + message2); + System.out.println(LINE_PREFIX + message3); + System.out.println(LINE_PREFIX + message4); + System.out.println(LINE_PREFIX + message5); + }*/ /** * Shows the list of persons to the user. @@ -989,12 +1015,12 @@ private static String extractPhoneFromPersonString(String encoded) { // phone is last arg, target is from prefix to end of string if (indexOfPhonePrefix > indexOfEmailPrefix) { - return removePrefixSign(encoded.substring(indexOfPhonePrefix, encoded.length()).trim(), + return removePrefix(encoded.substring(indexOfPhonePrefix, encoded.length()).trim(), PERSON_DATA_PREFIX_PHONE); // phone is middle arg, target is from own prefix to next prefix } else { - return removePrefixSign( + return removePrefix( encoded.substring(indexOfPhonePrefix, indexOfEmailPrefix).trim(), PERSON_DATA_PREFIX_PHONE); } @@ -1012,12 +1038,12 @@ private static String extractEmailFromPersonString(String encoded) { // email is last arg, target is from prefix to end of string if (indexOfEmailPrefix > indexOfPhonePrefix) { - return removePrefixSign(encoded.substring(indexOfEmailPrefix, encoded.length()).trim(), + return removePrefix(encoded.substring(indexOfEmailPrefix, encoded.length()).trim(), PERSON_DATA_PREFIX_EMAIL); // email is middle arg, target is from own prefix to next prefix } else { - return removePrefixSign( + return removePrefix( encoded.substring(indexOfEmailPrefix, indexOfPhonePrefix).trim(), PERSON_DATA_PREFIX_EMAIL); } @@ -1146,12 +1172,12 @@ private static String getUsageInfoForExitCommand() { /** * Removes sign(p/, d/, etc) from parameter string * - * @param s Parameter as a string - * @param sign Parameter sign to be removed + * @param fullstring Parameter as a string + * @param prefix Parameter sign to be removed * @return string without the sign */ - private static String removePrefixSign(String s, String sign) { - return s.replace(sign, ""); + private static String removePrefix(String fullstring, String prefix) { + return fullstring.replace(prefix, ""); } /**