示例#1
0
 public IFixedLengthKey FactoryMethod( )
 {
     TestCompoundKey testKey = new TestCompoundKey();
     testKey._key1 = _key1;
     testKey._key2 = _key2;
     return testKey;
 }
示例#2
0
 public void CompoundKeyTest()
 {
     TestCompoundKey keyFactory = new TestCompoundKey();
     BTree bTree = new BTree( _indexFileName, keyFactory );
     using( bTree )
     {
         bTree.Open();
         for( int i = 0; i < 10000; i++ )
         {
             bTree.InsertKey( new TestCompoundKey(  i , i ), i );
         }
         IntArrayList offsets = new IntArrayList();
         bTree.SearchForRange( new TestCompoundKey(  0, 0 ), new TestCompoundKey(  10000 , 10000 ), offsets );
         Assert.AreEqual( 10000, offsets.Count );
         bTree.Close();
     }
 }
示例#3
0
 public int Compare(object x, object y)
 {
     TestCompoundKey xKey = (TestCompoundKey)x;
     TestCompoundKey yKey = (TestCompoundKey)y;
     return (int)(xKey._key1 - yKey._key1);
 }
示例#4
0
 public IFixedLengthKey FactoryMethod( BinaryReader reader )
 {
     TestCompoundKey testKey = new TestCompoundKey();
     testKey.Read( reader );
     return testKey;
 }