*/
private final List<Contact> contacts;
-
/**
+ * Constructor which accepts maxContacts for maximum (initial) contacts and
+ * a client instance.
+ *
* @param maxContacts Maximum allowed contacts
* @param client Client instance to use
*/
*/
@Override
public void addContact (final Contact contact) {
+ assert(this.contacts instanceof List) : "this.contacts is not initialized";
+
this.contacts.add(contact);
}
@Override
public final int getColumnCount () {
+ assert(this.columnNames instanceof List) : "this.columnNames is not initialized";
+
return this.columnNames.size();
}
+ /**
+ * Getter for column name at given index.
+ *
+ * @param columnIndex Column index
+ * @return Human-readable column name
+ */
+ @Override
+ public String getColumnName (final int columnIndex) {
+ assert(this.columnNames instanceof List) : "this.columnNames is not initialized";
+
+ // Get column name at index
+ return this.columnNames.get(columnIndex);
+ }
+
/**
* Getter for whole contact list
*
*/
@Override
public List<Contact> getList () {
+ assert(this.contacts instanceof List) : "this.contacts is not initialized";
return Collections.unmodifiableList(this.contacts);
}
*/
@Override
public boolean isOwnContactAdded () {
+ assert(this.contacts instanceof List) : "this.contacts is not initialized";
+
// Default is not added
boolean isAdded = false;
*/
@Override
public final int size () {
+ assert(this.contacts instanceof List) : "this.contacts is not initialized";
return this.contacts.size();
}
* Fills the column names array with strings from bundle
*/
private void fillColumnNamesFromBundle () {
+ assert(this.columnNames instanceof List) : "this.columnNames is not initialized";
+
// Debug message
this.getLogger().trace("CALLED!");
this.getLogger().trace(MessageFormat.format("getColumnCount()={0}: EXIT!", this.getColumnCount()));
}
- /**
- * Getter for column name at given index.
- *
- * @param columnIndex Column index
- * @return Human-readable column name
- */
- @Override
- public String getColumnName (final int columnIndex) {
- // Get column name at index
- return this.columnNames.get(columnIndex);
- }
-
/**
* Flushes all entries by calling database backend
*/
* @return Contact instance or null
*/
private Contact getOwnContact () {
+ assert(this.contacts instanceof List) : "this.contacts is not initialized";
+
// Now get it back from address book, first get an iterator
Iterator<Contact> iterator = this.contacts.iterator();
* @return TRUE if found, FALSE if not found
*/
private boolean isContactAlreadyAdded (final Contact checkContact) throws NullPointerException {
+ assert(this.contacts instanceof List) : "this.contacts is not initialized";
+
// Default is not found
boolean isFound = false;