/** * Creates a new <code>SVNProperties</code> object copying the given one. * * @param properties * an initializer */ public SVNProperties(SVNProperties properties) { myProperties = new SVNHashMap(properties.myProperties); }
public void clear() { SVNHashMap.this.clear(); } }
public boolean contains(Object o) { return containsKey(o); } public boolean remove(Object o) {
public void addOldExternal(File path, String oldValue) { if (oldExternals == null) { oldExternals = new SVNHashMap(); } oldExternals.put(path, oldValue); }
public Object get(Object key) { key = key == null ? NULL_KEY : key; int hash = hashCode(key); int index = indexForHash(hash); TableEntry entry = myTable[index]; while (entry != null) { if (hash == entry.hash && eq(key, entry.key)) { return entry.value; } entry = entry.next; } return null; }
public boolean containsKey(Object key) { if (isEmpty()) { return false; } key = key == null ? NULL_KEY : key; int hash = hashCode(key); int index = indexForHash(hash); TableEntry entry = myTable[index]; while (entry != null) { if (entry.hash == hash && eq(key, entry.key)) { return true; } entry = entry.next; } return false; }
SVNHashMap reposInfo = new SVNHashMap(); SVNHashMap relPathInfo = new SVNHashMap(); for (Iterator rootUrls = reposInfo.keySet().iterator(); rootUrls.hasNext(); ) { reposRoot = (SVNURL) rootUrls.next(); reposRelPath = SVNWCUtils.isChild(reposRoot, url); repository = (SVNRepository) reposInfo.get(reposRoot); relPaths = (ArrayList<String>) relPathInfo.get(reposRoot); relPaths.add(reposRelPath); break; //appropriate SVNRepository/root was found, stop searching reposRoot = repository.getRepositoryRoot(true); repository.setLocation(reposRoot, false); reposInfo.put(reposRoot, repository); reposRelPath = SVNWCUtils.isChild(reposRoot, url); relPaths = new ArrayList<String>(); relPathInfo.put(reposRoot, relPaths); relPaths.add(reposRelPath); for (Iterator rootUrls = reposInfo.keySet().iterator(); rootUrls.hasNext(); ) { SVNURL reposRoot = (SVNURL) rootUrls.next(); SVNRepository repository = (SVNRepository) reposInfo.get(reposRoot); List<String> paths = (List<String>) relPathInfo.get(reposRoot); info = singleRepositoryDelete(repository, reposRoot, paths); if (info != null) { for (Object entry : reposInfo.entrySet()) { SVNRepository svnRepository = (SVNRepository) (((Map.Entry) entry).getValue());
public Object remove(Object key) { if (isEmpty()) { return null; } key = key == null ? NULL_KEY : key; int hash = hashCode(key); int index = indexForHash(hash); TableEntry entry = myTable[index]; TableEntry previousEntry = null; while (entry != null) { if (entry.hash == hash && entry.key.equals(key)) { if (previousEntry != null) { previousEntry.next = entry.next; } else { myTable[index] = entry.next; } myEntryCount--; myModCount++; return entry.getValue(); } previousEntry = entry; entry = entry.next; } return null; }
public Object put(Object key, Object value) { key = key == null ? NULL_KEY : key; int hash = hashCode(key); int index = indexForHash(hash); entry = entry.next; TableEntry newEntry = createTableEntry(key, value, hash); myModCount++; if (myEntryCount >= myTable.length) { resize(myTable.length * 2);
private SVNHashMap migrateTextBases(File dirAbsPath, File newWcRootAbsPath, SVNWCDbRoot root) throws SVNException { SVNHashMap textBasesInfo = new SVNHashMap(); File textBaseDir = SVNWCUtils.admChild(dirAbsPath, TEXT_BASE_SUBDIR); File[] files = SVNFileListUtil.listFiles(textBaseDir); TextBaseInfo info = (TextBaseInfo) textBasesInfo.get(versionedFileName); if (info == null) info = new TextBaseInfo(); fileInfo.sha1Checksum = sha1Checksum; fileInfo.md5Checksum = md5Checksum; textBasesInfo.put(versionedFileName, info);
public Object put(Object key, Object value) { key = key == null ? NULL_KEY : key; int hash = hashCode(key); int index = indexForHash(hash); myModCount++; if (myEntryCount >= myTable.length) { resize(myTable.length * 2);
public boolean contains(Object o) { if (o instanceof Map.Entry) { Map.Entry entry = (Map.Entry) o; if (SVNHashMap.this.containsKey(entry.getKey())) { Object value = SVNHashMap.this.get(entry.getKey()); if (value == null) { return entry.getValue() == null; } return value.equals(entry.getValue()); } } return false; }
public boolean containsValue(Object value) { if (isEmpty()) { return false; } if (value == null) { return containsNullValue(); } for (int i = 0; i < myTable.length; i++) { TableEntry entry = myTable[i]; while (entry != null) { if (value.equals(entry.value)) { return true; } entry = entry.next; } } return false; }
public int hashCode() { int h = 0; Iterator i = entrySet().iterator(); while (i.hasNext()) { h += i.next().hashCode(); } return h; }
public boolean contains(Object o) { return containsValue(o); } public void clear() {
private static int hashCode(Object key) { if (ourIsCompatibilityMode && String.class == key.getClass()) { int hash = 0; String str = (String) key; for (int i = 0; i < str.length(); i++) { hash = hash*33 + str.charAt(i); } return hash; } else if (key.getClass() == File.class) { return hashCode(((File) key).getPath()); } return key.hashCode(); }
private void resize(int newSize) { TableEntry[] oldTable = myTable; myTable = new TableEntry[newSize]; for (int i = 0; i < oldTable.length; i++) { TableEntry oldEntry = oldTable[i]; while (oldEntry != null) { int index = indexForHash(oldEntry.hash); TableEntry newEntry = myTable[index]; if (newEntry == null) { myTable[index] = oldEntry; } else { while (newEntry.next != null) { newEntry = newEntry.next; } newEntry.next = oldEntry; } TableEntry nextEntry = oldEntry.next; oldEntry.next = null; oldEntry = nextEntry; } } }
String name = (String) names.next(); SVNEntry entry = (SVNEntry) entries.get(name); TextBaseInfo info = (TextBaseInfo)textBases.get(name); if ("".equals(name)) { continue;
public boolean containsKey(Object key) { if (isEmpty()) { return false; } key = key == null ? NULL_KEY : key; int hash = hashCode(key); int index = indexForHash(hash); TableEntry entry = myTable[index]; while (entry != null) { if (entry.hash == hash && eq(key, entry.key)) { return true; } entry = entry.next; } return false; }