예제 #1
0
파일: HashSet4.cs 프로젝트: danfma/db4o-net
 public virtual bool Add(object obj)
 {
     if (_map.ContainsKey(obj))
     {
         return(false);
     }
     _map.Put(obj, obj);
     return(true);
 }
예제 #2
0
 public virtual void Add(object obj)
 {
     if (_seen.ContainsKey(obj))
     {
         return;
     }
     _queue.Add(obj);
     _seen.Put(obj, obj);
 }
예제 #3
0
 public virtual void TestContainsKey()
 {
     var table = new Hashtable4();
     Assert.IsFalse(table.ContainsKey(null));
     Assert.IsFalse(table.ContainsKey("foo"));
     table.Put("foo", null);
     Assert.IsTrue(table.ContainsKey("foo"));
     table.Put("bar", "baz");
     Assert.IsTrue(table.ContainsKey("bar"));
     Assert.IsFalse(table.ContainsKey("baz"));
     Assert.IsTrue(table.ContainsKey("foo"));
     table.Remove("foo");
     Assert.IsTrue(table.ContainsKey("bar"));
     Assert.IsFalse(table.ContainsKey("foo"));
 }
예제 #4
0
		public virtual void Test()
		{
			Hashtable4 ht = new Hashtable4();
			ObjectContainerBase container = Container();
			container.ShowInternalClasses(true);
			IQuery q = Db().Query();
			q.Constrain(typeof(Db4oDatabase));
			IObjectSet objectSet = q.Execute();
			while (objectSet.HasNext())
			{
				Db4oDatabase identity = (Db4oDatabase)objectSet.Next();
				Assert.IsFalse(ht.ContainsKey(identity.i_signature));
				ht.Put(identity.i_signature, string.Empty);
			}
			container.ShowInternalClasses(false);
		}