/**
* A manager for contacts.
- *
+ * <p>
* @author Roland Haeder
* @version 0.0
*/
/**
* Constructor which accepts maxContacts for maximum (initial) contacts and
* a client instance.
- *
+ * <p>
* @param client Client instance to use
* @throws java.sql.SQLException If an SQL error occurs
*/
/**
* Adds given Contact instance to list
- *
+ * <p>
* @param contact Contact instance to add
*/
@Override
- public void addContact (final Contact contact) throws ContactAlreadyAddedException {
+ public void addContact (final Contact contact) throws ContactAlreadyAddedException {
// Trace message
this.getLogger().trace(MessageFormat.format("contact={0} - CALLED!", contact)); //NOI18N
/**
* Let the user change address data
- *
+ * <p>
* @param contact Instance to change data
*/
@Override
if (null == contact) {
// Abort here
throw new NullPointerException("contact is null"); //NOI18N
- } if (!(this.getClient() instanceof AddressbookClient)) {
+ }
+ if (!(this.getClient() instanceof AddressbookClient)) {
// Cannot cast
throw new IllegalArgumentException(MessageFormat.format("this.getClient()={0} does not implement AddressbookClient", this.getClient())); //NOI18N
}
/**
* Let the user change "name data"
- *
+ * <p>
* @param contact Instance to change data
*/
@Override
/**
* Let the user change other data
- *
- * @param contact Instance to change data
- * TODO Didn't handle birthday
+ * <p>
+ * @param contact Instance to change data TODO Didn't handle birthday
*/
@Override
public void doChangeOtherData (final Contact contact) {
* Allows the user to change his/her own data
*/
@Override
- public void doChangeOwnData () throws IOException, SQLException, NoSuchMethodException, IllegalAccessException, InvocationTargetException{
+ public void doChangeOwnData () throws IOException, SQLException, NoSuchMethodException, IllegalAccessException, InvocationTargetException {
// Trace message
this.getLogger().trace("CALLED!"); //NOI18N
/**
* Shuts down this contact manager
- *
+ * <p>
* @throws java.sql.SQLException If an SQL error occurs
* @throws java.io.IOException If an IO error occurs
*/
/**
* Asks the user for his/her cellphone number
- *
+ * <p>
* @return User's cellphone number
*/
@Override
/**
* Asks the user for his/her city's name
- *
+ * <p>
* @return City's name of the user
*/
@Override
/**
* Asks the user for his/her city's name
- *
+ * <p>
* @return City's name of the user
*/
@Override
/**
* Asks the user for his/her company name
- *
+ * <p>
* @return User's company name
*/
@Override
/**
* Asks user for his/her own country code
- *
+ * <p>
* @return User's own country code
*/
@Override
/**
* Asks user for his/her own country code
- *
+ * <p>
* @return User's own country code
*/
@Override
/**
* Asks the user for family name
- *
+ * <p>
* @return Family name of the user
*/
@Override
/**
* Asks the user for family name
- *
+ * <p>
* @return Family name of the user
*/
@Override
/**
* Asks the user for surname
- *
+ * <p>
* @return Surname of the user
*/
@Override
public String enterOwnFirstName () {
// Trace message
this.getLogger().trace("CALLED!"); //NOI18N
-
+
// Get and cast client instance
AddressbookClient client = (AddressbookClient) this.getClient();
-
+
return client.enterString(2, 50, "Bitte geben Sie Ihren Vornamen ein: ", false);
}
/**
* Asks the user for gender, until a valid has been entered
- *
+ * <p>
* @return Gender of the user
*/
@Override
/**
* Asks the user for phone number
- *
+ * <p>
* @return Phone number of the user
*/
@Override
/**
* Asks the user for own street (including number)
- *
+ * <p>
* @return Own street an number
*/
@Override
/**
* Asks the user for own ZIP code
- *
+ * <p>
* @return ZIP code
*/
@Override
/**
* Checks whether own contact is already added by checking all entries for
* isOwnContact flag
- *
+ * <p>
* @return Whether own contact is already added
*/
@Override
/**
* Adds given contact to address book and flushes all entries to database
- *
- * @param contact Contact being added
- * TODO Add check for book size
+ * <p>
+ * @param contact Contact being added TODO Add check for book size
*/
@Override
public void registerContact (final Contact contact) {
throw new NullPointerException("contact is null"); //NOI18N
}
try {
+
// Debug message
- /* NOISY-DEBUG: */ this.getLogger().debug(MessageFormat.format("Adding '{0}' '{1}' at pos '{2}' ...", contact.getFirstName(), contact.getFamilyName(), this.size())); //NOI18N
+ /*
+ * NOISY-DEBUG:
+ */ this.getLogger().debug(MessageFormat.format("Adding '{0}' '{1}' at pos '{2}' ...", contact.getFirstName(), contact.getFamilyName(), this.size())); //NOI18N
- // Check if contact is found
+ // Check if contact is found
if (((AddressbookContactFrontend) this.getFrontend()).isContactFound(contact)) {
// Contact already added
// TODO Do something here
String[] tokens = this.getArrayFromString(key, "."); //NOI18N
// Token array must contain 4 elements (AddressbookContactManager.columnName.foo.text)
- assert(tokens.length == 4) : MessageFormat.format("Array tokens contains not 4 elements: {0}", Arrays.toString(tokens)); //NOI18N
+ assert (tokens.length == 4) : MessageFormat.format("Array tokens contains not 4 elements: {0}", Arrays.toString(tokens)); //NOI18N
// Get pre-last element
String columnName = tokens[tokens.length - 2];
/**
* "Getter" for own contact instance or null if not found
- *
+ * <p>
* @return Contact instance or null
* @throws java.sql.SQLException If an SQL error occurs
* @throws java.io.IOException If an IO error occurs