当前位置: 首页>>代码示例>>C#>>正文


C# Foundation.Hashtable4类代码示例

本文整理汇总了C#中Db4objects.Db4o.Foundation.Hashtable4的典型用法代码示例。如果您正苦于以下问题:C# Hashtable4类的具体用法?C# Hashtable4怎么用?C# Hashtable4使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Hashtable4类属于Db4objects.Db4o.Foundation命名空间,在下文中一共展示了Hashtable4类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: TestRetrieve

		/// <exception cref="System.Exception"></exception>
		public virtual void TestRetrieve()
		{
			Hashtable4 uuidCache = new Hashtable4();
			AssertItemsCanBeRetrievedByUUID(uuidCache);
			Reopen();
			AssertItemsCanBeRetrievedByUUID(uuidCache);
		}
开发者ID:Galigator,项目名称:db4o,代码行数:8,代码来源:UUIDTestCase.cs

示例2: TestByteArrayKeys

 public virtual void TestByteArrayKeys()
 {
     byte[] key1 = {1, 2, 3};
     byte[] key2 = {3, 2, 1};
     byte[] key3 = {3, 2, 1};
     // same values as key2
     var table = new Hashtable4(2);
     table.Put(key1, "foo");
     table.Put(key2, "bar");
     Assert.AreEqual("foo", table.Get(key1));
     Assert.AreEqual("bar", table.Get(key2));
     Assert.AreEqual(2, CountKeys(table));
     Assert.AreEqual(2, table.Size());
     table.Put(key3, "baz");
     Assert.AreEqual("foo", table.Get(key1));
     Assert.AreEqual("baz", table.Get(key2));
     Assert.AreEqual(2, CountKeys(table));
     Assert.AreEqual(2, table.Size());
     Assert.AreEqual("baz", table.Remove(key2));
     Assert.AreEqual(1, CountKeys(table));
     Assert.AreEqual(1, table.Size());
     Assert.AreEqual("foo", table.Remove(key1));
     Assert.AreEqual(0, CountKeys(table));
     Assert.AreEqual(0, table.Size());
 }
开发者ID:masroore,项目名称:db4o,代码行数:25,代码来源:Hashtable4TestCase.cs

示例3: TestToString

 public virtual void TestToString()
 {
     var table = new Hashtable4();
     table.Put("foo", "bar");
     table.Put("bar", "baz");
     Assert.AreEqual(Iterators.Join(table.Iterator(), "{", "}", ", "), table.ToString(
         ));
 }
开发者ID:masroore,项目名称:db4o,代码行数:8,代码来源:Hashtable4TestCase.cs

示例4: KnownClassesRepository

		static KnownClassesRepository()
		{
			Primitives = new Hashtable4();
			Type[] primitiveArray = Platform4.PrimitiveTypes();
			for (int primitiveIndex = 0; primitiveIndex < primitiveArray.Length; ++primitiveIndex)
			{
				Type primitive = primitiveArray[primitiveIndex];
				RegisterPrimitive(primitive);
			}
		}
开发者ID:erdincay,项目名称:db4o,代码行数:10,代码来源:KnownClassesRepository.cs

示例5: ClientTransactionPool

		public ClientTransactionPool(LocalObjectContainer mainContainer)
		{
			// Transaction -> ContainerCount
			// String -> ContainerCount
			ClientTransactionPool.ContainerCount mainEntry = new ClientTransactionPool.ContainerCount
				(mainContainer, 1);
			_transaction2Container = new Hashtable4();
			_fileName2Container = new Hashtable4();
			_fileName2Container.Put(mainContainer.FileName(), mainEntry);
			_mainContainer = mainContainer;
		}
开发者ID:Orvid,项目名称:SQLInterfaceCollection,代码行数:11,代码来源:ClientTransactionPool.cs

示例6: TestClear

 public virtual void TestClear()
 {
     var table = new Hashtable4();
     for (var i = 0; i < 2; ++i)
     {
         table.Clear();
         Assert.AreEqual(0, table.Size());
         table.Put("foo", "bar");
         Assert.AreEqual(1, table.Size());
         AssertIterator(table, new object[] {"foo"});
     }
 }
开发者ID:masroore,项目名称:db4o,代码行数:12,代码来源:Hashtable4TestCase.cs

示例7: TestContainsKey

 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"));
 }
开发者ID:masroore,项目名称:db4o,代码行数:15,代码来源:Hashtable4TestCase.cs

示例8: Test

		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);
		}
开发者ID:superyfwy,项目名称:db4o,代码行数:16,代码来源:DatabaseUnicityTest.cs

示例9: AssertItemsCanBeRetrievedByUUID

		protected virtual void AssertItemsCanBeRetrievedByUUID(Hashtable4 uuidCache)
		{
			IQuery q = NewItemQuery();
			IObjectSet objectSet = q.Execute();
			while (objectSet.HasNext())
			{
				UUIDTestCase.Item item = (UUIDTestCase.Item)objectSet.Next();
				Db4oUUID uuid = Uuid(item);
				Assert.IsNotNull(uuid);
				Assert.AreSame(item, Db().GetByUUID(uuid));
				Db4oUUID cached = (Db4oUUID)uuidCache.Get(item.name);
				if (cached != null)
				{
					Assert.AreEqual(cached, uuid);
				}
				else
				{
					uuidCache.Put(item.name, uuid);
				}
			}
		}
开发者ID:Galigator,项目名称:db4o,代码行数:21,代码来源:UUIDTestCase.cs

示例10: SafeConfigurationItems

		private Hashtable4 SafeConfigurationItems()
		{
			Hashtable4 items = ConfigurationItems();
			if (items == null)
			{
				items = new Hashtable4(16);
				_config.Put(ConfigurationItemsKey, items);
			}
			return items;
		}
开发者ID:Orvid,项目名称:SQLInterfaceCollection,代码行数:10,代码来源:Config4Impl.cs

示例11: ExceptionalClasses

		public Hashtable4 ExceptionalClasses()
		{
			Hashtable4 exceptionalClasses = (Hashtable4)_config.Get(ExceptionalClassesKey);
			if (exceptionalClasses == null)
			{
				exceptionalClasses = new Hashtable4(16);
				_config.Put(ExceptionalClassesKey, exceptionalClasses);
			}
			return exceptionalClasses;
		}
开发者ID:Orvid,项目名称:SQLInterfaceCollection,代码行数:10,代码来源:Config4Impl.cs

示例12: Db4oSignatureMap

		internal Db4oSignatureMap(IInternalObjectContainer stream)
		{
			_stream = stream;
			_identities = new Hashtable4();
		}
开发者ID:erdincay,项目名称:db4o,代码行数:5,代码来源:Db4oSignatureMap.cs

示例13: DeepCloneInternal

 protected virtual Hashtable4 DeepCloneInternal(Hashtable4
     ret, object obj)
 {
     ret._mask = _mask;
     ret._maximumSize = _maximumSize;
     ret._size = _size;
     ret._tableSize = _tableSize;
     ret._table = new HashtableIntEntry[_tableSize];
     for (var i = 0; i < _tableSize; i++)
     {
         if (_table[i] != null)
         {
             ret._table[i] = (HashtableIntEntry) _table[i].DeepClone(obj);
         }
     }
     return ret;
 }
开发者ID:masroore,项目名称:db4o,代码行数:17,代码来源:Hashtable4.cs

示例14: ExceptionalFields

		private Hashtable4 ExceptionalFields()
		{
			Hashtable4 exceptionalFieldsCollection = ExceptionalFieldsOrNull();
			if (exceptionalFieldsCollection == null)
			{
				exceptionalFieldsCollection = new Hashtable4(16);
				_config.Put(ExceptionalFieldsKey, exceptionalFieldsCollection);
			}
			return exceptionalFieldsCollection;
		}
开发者ID:erdincay,项目名称:db4o,代码行数:10,代码来源:Config4Class.cs

示例15: HashSet4

		public HashSet4(int count)
		{
			_map = new Hashtable4(count);
		}
开发者ID:bvangrinsven,项目名称:db4o-net,代码行数:4,代码来源:HashSet4.cs


注:本文中的Db4objects.Db4o.Foundation.Hashtable4类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。