public IFixedLengthKey FactoryMethod( ) { TestCompoundKey testKey = new TestCompoundKey(); testKey._key1 = _key1; testKey._key2 = _key2; return testKey; }
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(); } }
public int Compare(object x, object y) { TestCompoundKey xKey = (TestCompoundKey)x; TestCompoundKey yKey = (TestCompoundKey)y; return (int)(xKey._key1 - yKey._key1); }
public IFixedLengthKey FactoryMethod( BinaryReader reader ) { TestCompoundKey testKey = new TestCompoundKey(); testKey.Read( reader ); return testKey; }