Package org.apache.directory.mavibot.btree.comparator

Examples of org.apache.directory.mavibot.btree.comparator.ByteComparator


    /**
     * Create a new instance of ByteSerializer
     */
    public ByteSerializer()
    {
        super( new ByteComparator() );
    }
View Full Code Here


    /**
     * Create a new instance of ByteSerializer
     */
    public ByteSerializer()
    {
        super( new ByteComparator() );
    }
View Full Code Here

    /**
     * Create a new instance of ByteSerializer
     */
    public ByteSerializer()
    {
        super( new ByteComparator() );
    }
View Full Code Here

public class ByteComparatorTest
{
    @Test
    public void testByteComparator()
    {
        ByteComparator comparator = new ByteComparator();

        assertEquals( 0, comparator.compare( null, null ) );
        assertEquals( 0, comparator.compare( ( byte ) 0x00, ( byte ) 0x00 ) );
        assertEquals( 0, comparator.compare( ( byte ) 0xFE, ( byte ) 0xFE ) );
        assertEquals( 1, comparator.compare( ( byte ) 0x01, null ) );
        assertEquals( 1, comparator.compare( ( byte ) 0x01, ( byte ) 0x00 ) );
        assertEquals( 1, comparator.compare( ( byte ) 0x00, ( byte ) 0xFF ) );
        assertEquals( 1, comparator.compare( ( byte ) 0x7F, ( byte ) 0x01 ) );
        assertEquals( -1, comparator.compare( null, ( byte ) 0x00 ) );
        assertEquals( -1, comparator.compare( null, ( byte ) 0xFF ) );
        assertEquals( -1, comparator.compare( ( byte ) 0x00, ( byte ) 0x01 ) );
        assertEquals( -1, comparator.compare( ( byte ) 0xF0, ( byte ) 0xFF ) );
        assertEquals( -1, comparator.compare( ( byte ) 0xFF, ( byte ) 0x01 ) );
    }
View Full Code Here

TOP

Related Classes of org.apache.directory.mavibot.btree.comparator.ByteComparator

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.