(int direction)
| 2034 | } |
| 2035 | |
| 2036 | public void searchActiveContact(int direction) { |
| 2037 | Vector activeContacts = new Vector(); |
| 2038 | int nowContact = -1, contacts = -1, currentContact = -1; |
| 2039 | synchronized (hContacts) { |
| 2040 | int j = hContacts.size(); |
| 2041 | for (int i = 0; i < j; i++) { |
| 2042 | Contact c = (Contact) hContacts.elementAt(i); |
| 2043 | if (c.active()) { |
| 2044 | activeContacts.addElement(c); |
| 2045 | contacts = contacts + 1; |
| 2046 | if (c == activeContact) { |
| 2047 | nowContact = contacts; |
| 2048 | currentContact = contacts; |
| 2049 | } |
| 2050 | } |
| 2051 | } |
| 2052 | } |
| 2053 | |
| 2054 | int size = activeContacts.size(); |
| 2055 | |
| 2056 | if (size == 0) { |
| 2057 | return; |
| 2058 | } |
| 2059 | |
| 2060 | try { |
| 2061 | nowContact += direction; |
| 2062 | if (nowContact < 0) { |
| 2063 | nowContact = size - 1; |
| 2064 | } |
| 2065 | if (nowContact >= size) { |
| 2066 | nowContact = 0; |
| 2067 | } |
| 2068 | |
| 2069 | if (currentContact == nowContact) { |
| 2070 | return; |
| 2071 | } |
| 2072 | |
| 2073 | Contact c = (Contact) activeContacts.elementAt(nowContact); |
| 2074 | c.getMsgList(); |
| 2075 | } catch (Exception e) { |
| 2076 | } |
| 2077 | } |
| 2078 | |
| 2079 | public void deleteContact(Contact c) { |
| 2080 | synchronized (hContacts) { |
no test coverage detected