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

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