/**\r
* ZIP code\r
*/\r
- private int zipCode;\r
+ private long zipCode;\r
\r
/**\r
* No instances can be created of this class\r
*\r
* @return the zipCode\r
*/\r
- public int getZipCode () {\r
+ public long getZipCode () {\r
return this.zipCode;\r
}\r
\r
*\r
* @param zipCode the zipCode to set\r
*/\r
- public void setZipCode (final int zipCode) {\r
+ public void setZipCode (final long zipCode) {\r
this.zipCode = zipCode;\r
}\r
\r
* @param city City\r
* @param countryCode Country code\r
*/\r
- public void updateAddressData (final String street, final int zipCode, final String city, final String countryCode) {\r
+ public void updateAddressData (final String street, final long zipCode, final String city, final String countryCode) {\r
// Set all\r
if (street != null) {\r
this.setStreet(street);\r
}\r
- if (city != null) {\r
+ if (zipCode > 0) {\r
this.setZipCode(zipCode);\r
}\r
if (city != null) {\r
* @param cellphoneNumber Cellphone number\r
* @param faxNumber Fax number\r
* @param emailAddress Email address\r
+ * @param birthday Birth day\r
* @param comment Comments\r
*/\r
- public void updateOtherData (final String phoneNumber, final String cellphoneNumber, final String faxNumber, final String emailAddress, final String comment) {\r
+ public void updateOtherData (final String phoneNumber, final String cellphoneNumber, final String faxNumber, final String emailAddress, final String birthday, final String comment) {\r
// Set all\r
if (phoneNumber != null) {\r
this.setPhoneNumber(phoneNumber);\r
if (emailAddress != null) {\r
this.setEmailAddress(emailAddress);\r
}\r
+ if (birthday != null) {\r
+ this.setBirthday(birthday);\r
+ }\r
if (comment != null) {\r
this.setComment(comment);\r
}\r
*\r
* @return the zipCode\r
*/\r
- public int getZipCode();\r
+ public long getZipCode();\r
\r
/**\r
* City\r
* @param city City\r
* @param countryCode Country code\r
*/\r
- public void updateAddressData (final String street, final int zipCode, final String city, final String countryCode);\r
+ public void updateAddressData (final String street, final long zipCode, final String city, final String countryCode);\r
\r
/**\r
* Updates name data in this Contact instance\r
* @param cellNumber Cellphone number\r
* @param faxNumber Fax number\r
* @param email Email address\r
+ * @param birthday Birthday\r
* @param comment Comments\r
*/\r
- public void updateOtherData (final String phoneNumber, final String cellNumber, final String faxNumber, final String email, final String comment);\r
+ public void updateOtherData (final String phoneNumber, final String cellNumber, final String faxNumber, final String email, final String birthday, final String comment);\r
}\r
contact.updateNameData(gender, null, null, null);\r
break;\r
\r
+ case 2: // Surname\r
+ assert(contact instanceof Contact) : "First token was not boolean";\r
+ assert(gender != '?') : "Gender is not detected.";\r
+\r
+ // Update data\r
+ contact.updateNameData(gender, strippedToken, null, null);\r
+ break;\r
+\r
+ case 3: // Family name\r
+ assert(contact instanceof Contact) : "First token was not boolean";\r
+ assert(gender != '?') : "Gender is not detected.";\r
+\r
+ // Update data\r
+ contact.updateNameData(gender, null, strippedToken, null);\r
+ break;\r
+\r
+ case 4: // Company name\r
+ assert(contact instanceof Contact) : "First token was not boolean";\r
+ assert(gender != '?') : "Gender is not detected.";\r
+\r
+ // Update data\r
+ contact.updateNameData(gender, null, null, strippedToken);\r
+ break;\r
+\r
+ case 5: // Street number\r
+ assert(contact instanceof Contact) : "First token was not boolean";\r
+\r
+ // Update data\r
+ contact.updateAddressData(strippedToken, 0, null, null);\r
+ break;\r
+\r
+ case 6: // ZIP code\r
+ assert(contact instanceof Contact) : "First token was not boolean";\r
+\r
+ // Update data\r
+ contact.updateAddressData(null, num, null, null);\r
+ break;\r
+\r
+ case 7: // City name\r
+ assert(contact instanceof Contact) : "First token was not boolean";\r
+\r
+ // Update data\r
+ contact.updateAddressData(null, 0, strippedToken, null);\r
+ break;\r
+\r
+ case 8: // Country code\r
+ assert(contact instanceof Contact) : "First token was not boolean";\r
+\r
+ // Update data\r
+ contact.updateAddressData(null, 0, null, strippedToken);\r
+ break;\r
+\r
+ case 9: // Phone number\r
+ assert(contact instanceof Contact) : "First token was not boolean";\r
+\r
+ // Update data\r
+ contact.updateOtherData(strippedToken, null, null, null, null, null);\r
+ break;\r
+\r
+ case 10: // Fax number\r
+ assert(contact instanceof Contact) : "First token was not boolean";\r
+\r
+ // Update data\r
+ contact.updateOtherData(null, strippedToken, null, null, null, null);\r
+ break;\r
+\r
+ case 11: // Cellphone number\r
+ assert(contact instanceof Contact) : "First token was not boolean";\r
+\r
+ // Update data\r
+ contact.updateOtherData(null, null, strippedToken, null, null, null);\r
+ break;\r
+\r
+ case 12: // Email address\r
+ assert(contact instanceof Contact) : "First token was not boolean";\r
+\r
+ // Update data\r
+ contact.updateOtherData(null, null, null, strippedToken, null, null);\r
+ break;\r
+\r
+ case 13: // Birthday\r
+ assert(contact instanceof Contact) : "First token was not boolean";\r
+\r
+ // Update data\r
+ contact.updateOtherData(null, null, null, null, strippedToken, null);\r
+ break;\r
+\r
+ case 14: // Birthday\r
+ assert(contact instanceof Contact) : "First token was not boolean";\r
+\r
+ // Update data\r
+ contact.updateOtherData(null, null, null, null, null, strippedToken);\r
+ break;\r
+\r
default: // New data entry\r
- this.getLogger().warn("Will not handle unknown data " + strippedToken + " at index " + count);\r
+ this.getLogger().warn(MessageFormat.format("Will not handle unknown data {0} at index {1}", strippedToken, count));\r
break;\r
}\r
\r
\r
try {\r
input = this.storageFile.readLine();\r
- } catch (IOException ex) {\r
+ } catch (final IOException ex) {\r
this.getLogger().catching(ex);\r
}\r
\r