public override bool SameKeyAs(HashtableIntEntry other)
		{
			if (!base.SameKeyAs(other))
			{
				return false;
			}
			return other._object == _object;
		}
Beispiel #2
0
		protected virtual void PutEntry(HashtableIntEntry newEntry)
		{
			HashtableIntEntry existing = FindWithSameKey(newEntry);
			if (null != existing)
			{
				Replace(existing, newEntry);
			}
			else
			{
				Insert(newEntry);
			}
		}
Beispiel #3
0
		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);
 }
Beispiel #5
0
 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);
 }
Beispiel #6
0
 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;
 }
Beispiel #7
0
 public HashtableIterator(HashtableIntEntry[] table)
 {
     _table = table;
     Reset();
 }
Beispiel #8
0
 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);
 }
Beispiel #10
0
		public override bool SameKeyAs(HashtableIntEntry other)
		{
			return other is Db4objects.Db4o.Foundation.HashtableObjectEntry ? HasKey(((Db4objects.Db4o.Foundation.HashtableObjectEntry
				)other)._objectKey) : false;
		}
Beispiel #11
0
		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;
		}
Beispiel #13
0
 public virtual void Reset()
 {
     _currentEntry = null;
     _currentIndex = 0;
     CheckInvalidTable();
 }
Beispiel #14
0
		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));
 }
Beispiel #16
0
        public virtual object Get(object key)
        {
            HashtableIntEntry entry = GetEntry(key);

            return(entry == null ? null : entry._object);
        }
Beispiel #17
0
		protected virtual void RemoveEntry(HashtableIntEntry predecessor, HashtableIntEntry
			 entry)
		{
			if (predecessor != null)
			{
				predecessor._next = entry._next;
			}
			else
			{
				_table[EntryIndex(entry)] = entry._next;
			}
			_size--;
		}
Beispiel #18
0
		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;
			}
		}
Beispiel #19
0
		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);
 }
Beispiel #22
0
 public virtual void Reset()
 {
     _currentEntry = null;
     _currentIndex = 0;
     CheckInvalidTable();
 }
Beispiel #23
0
		protected virtual int EntryIndex(HashtableIntEntry entry)
		{
			return entry._key & _mask;
		}