* getName, getLocation -> getByName, getByLocation

This commit is contained in:
ragnarok
2005-10-09 03:47:12 +00:00
committed by zzz
parent e7ad516685
commit 9297564555
12 changed files with 27 additions and 27 deletions

View File

@ -16,7 +16,7 @@ public class PetNameDB {
_names = Collections.synchronizedMap(new HashMap());
}
public PetName getName(String name) { return (PetName)_names.get(name); }
public PetName getByName(String name) { return (PetName)_names.get(name); }
public void add(PetName pn) { _names.put(pn.getName(), pn); }
public void clear() { _names.clear(); }
public boolean contains(PetName pn) { return _names.containsValue(pn); }
@ -38,7 +38,7 @@ public class PetNameDB {
return rv;
}
public PetName getLocation(String location) {
public PetName getByLocation(String location) {
if (location == null) return null;
synchronized (_names) {
for (Iterator iter = iterator(); iter.hasNext(); ) {

View File

@ -51,7 +51,7 @@ public class PetNameNamingService extends NamingService {
}
public Destination lookup(String hostname) {
PetName name = _petnameDb.getName(hostname);
PetName name = _petnameDb.getByName(hostname);
if (name != null && name.getNetwork().equalsIgnoreCase("i2p")) {
return lookupBase64(name.getLocation());
} else {
@ -60,6 +60,6 @@ public class PetNameNamingService extends NamingService {
}
public String reverseLookup(Destination dest) {
return _petnameDb.getLocation(dest.toBase64()).getName();
return _petnameDb.getByLocation(dest.toBase64()).getName();
}
}