public override bool SameKeyAs(HashtableIntEntry other) { if (!base.SameKeyAs(other)) { return false; } return other._object == _object; }
protected virtual void PutEntry(HashtableIntEntry newEntry) { HashtableIntEntry existing = FindWithSameKey(newEntry); if (null != existing) { Replace(existing, newEntry); } else { Insert(newEntry); } }
protected virtual HashtableIntEntry FindWithSameKey(HashtableIntEntry newEntry) { HashtableIntEntry existing = _table[EntryIndex(newEntry)]; while (null != existing) { if (existing.SameKeyAs(newEntry)) { return existing; } existing = existing._next; } return null; }
protected virtual Db4objects.Db4o.Foundation.HashtableIntEntry DeepCloneInternal( Db4objects.Db4o.Foundation.HashtableIntEntry entry, object obj) { entry._key = _key; entry._next = _next; if (_object is IDeepClone) { entry._object = ((IDeepClone)_object).DeepClone(obj); } else { entry._object = _object; } if (_next != null) { entry._next = (Db4objects.Db4o.Foundation.HashtableIntEntry)_next.DeepClone(obj); } return(entry); }
public virtual bool MoveNext() { if (IsBeyondLast()) { return(false); } if (_currentEntry != null) { _currentEntry = _currentEntry._next; } while (_currentEntry == null) { if (_currentIndex >= _table.Length) { PositionBeyondLast(); return(false); } _currentEntry = _table[_currentIndex++]; } return(true); }
public virtual bool MoveNext() { if (IsBeyondLast()) { return false; } if (_currentEntry != null) { _currentEntry = _currentEntry._next; } while (_currentEntry == null) { if (_currentIndex >= _table.Length) { PositionBeyondLast(); return false; } _currentEntry = _table[_currentIndex++]; } return true; }
public HashtableIterator(HashtableIntEntry[] table) { _table = table; Reset(); }
protected virtual int EntryIndex(HashtableIntEntry entry) { return(entry._key & _mask); }
public override bool SameKeyAs(HashtableIntEntry other) { return(other is Db4objects.Db4o.Foundation.HashtableLongEntry ? ((Db4objects.Db4o.Foundation.HashtableLongEntry )other)._longKey == _longKey : false); }
public override bool SameKeyAs(HashtableIntEntry other) { return other is Db4objects.Db4o.Foundation.HashtableObjectEntry ? HasKey(((Db4objects.Db4o.Foundation.HashtableObjectEntry )other)._objectKey) : false; }
protected override HashtableIntEntry DeepCloneInternal(HashtableIntEntry entry, object obj) { ((Db4objects.Db4o.Foundation.HashtableObjectEntry)entry)._objectKey = _objectKey; return base.DeepCloneInternal(entry, obj); }
public override bool SameKeyAs(HashtableIntEntry other) { return other is Db4objects.Db4o.Foundation.HashtableLongEntry ? ((Db4objects.Db4o.Foundation.HashtableLongEntry )other)._longKey == _longKey : false; }
public virtual void Reset() { _currentEntry = null; _currentIndex = 0; CheckInvalidTable(); }
private void Insert(HashtableIntEntry newEntry) { _size++; if (_size > _maximumSize) { IncreaseSize(); } int index = EntryIndex(newEntry); newEntry._next = _table[index]; _table[index] = newEntry; }
protected override HashtableIntEntry DeepCloneInternal(HashtableIntEntry entry, object obj) { ((Db4objects.Db4o.Foundation.HashtableObjectEntry)entry)._objectKey = _objectKey; return(base.DeepCloneInternal(entry, obj)); }
public virtual object Get(object key) { HashtableIntEntry entry = GetEntry(key); return(entry == null ? null : entry._object); }
protected virtual void RemoveEntry(HashtableIntEntry predecessor, HashtableIntEntry entry) { if (predecessor != null) { predecessor._next = entry._next; } else { _table[EntryIndex(entry)] = entry._next; } _size--; }
private void Reposition(HashtableIntEntry entry) { HashtableIntEntry currentEntry = entry; HashtableIntEntry nextEntry = null; while (currentEntry != null) { nextEntry = currentEntry._next; currentEntry._next = _table[EntryIndex(currentEntry)]; _table[EntryIndex(currentEntry)] = currentEntry; currentEntry = nextEntry; } }
private void Replace(HashtableIntEntry existing, HashtableIntEntry newEntry) { newEntry._next = existing._next; HashtableIntEntry entry = _table[EntryIndex(existing)]; if (entry == existing) { _table[EntryIndex(existing)] = newEntry; } else { while (entry._next != existing) { entry = entry._next; } entry._next = newEntry; } }
public override bool SameKeyAs(HashtableIntEntry other) { return(other is Db4objects.Db4o.Foundation.HashtableObjectEntry ? HasKey(((Db4objects.Db4o.Foundation.HashtableObjectEntry )other)._objectKey) : false); }
public virtual bool SameKeyAs(Db4objects.Db4o.Foundation.HashtableIntEntry other) { return(_key == other._key); }
public virtual void Reset() { _currentEntry = null; _currentIndex = 0; CheckInvalidTable(); }
protected virtual int EntryIndex(HashtableIntEntry entry) { return entry._key & _mask; }