@Test public void testDelete() { Hosts hosts = new Hosts(RuntimeEnvironment.application, "hosts.db"); hosts.put("ni.hao", "127.0.0.1"); assertEquals("ni.hao/127.0.0.1", hosts.get("ni.hao").toString()); hosts.put("ni.hao", "127.0.0.2"); hosts.delete("ni.hao"); assertEquals(null, hosts.get("ni.hao")); hosts.delete(null); }
public void delete(String host) { db.delete(TABLE_HOSTS, COLUMN_HOST + " = ?", new String[] { host }); }
Hosts { public void delete(String host) { db.delete(TABLE_HOSTS, COLUMN_HOST + " = ?", new String[] { host }); } }
Hosts { public void delete(String host) { db.delete(TABLE_HOSTS, COLUMN_HOST + " = ?", new String[] { host }); } Hosts(Context context, String name); }
Hosts { public void delete(String host) { db.delete(TABLE_HOSTS, COLUMN_HOST + " = ?", new String[] { host }); } Hosts(Context context, String name); @Nullable InetAddress get(String host); boolean put(String host, String ip); void delete(String host); List<Pair<String, String>> getAll(); @Nullable static InetAddress toInetAddress(String host, String ip); static boolean isValidHost(String host); static boolean isValidIp(String ip); }
Hosts { public void delete(String host) { db.delete(TABLE_HOSTS, COLUMN_HOST + " = ?", new String[] { host }); } Hosts(Context context, String name); @Nullable InetAddress get(String host); boolean put(String host, String ip); void delete(String host); List<Pair<String, String>> getAll(); @Nullable static InetAddress toInetAddress(String host, String ip); static boolean isValidHost(String host); static boolean isValidIp(String ip);  }