Package org.drools.core.util

Examples of org.drools.core.util.HierarchyEncoderImpl.encode()


    @Test
    public void testHierManyRootsPropagation() {
        HierarchyEncoderImpl encoder = new HierarchyEncoderImpl();

        encoder.encode( "A", Collections.EMPTY_LIST );
        encoder.encode( "B", Arrays.asList( "A" ) );
        encoder.encode( "C", Arrays.asList( "A" ) );
        encoder.encode( "D", Arrays.asList( "B", "C" ) );
        encoder.encode( "E", Collections.EMPTY_LIST );

        System.out.println( encoder );
View Full Code Here


    public void testHierManyRootsPropagation() {
        HierarchyEncoderImpl encoder = new HierarchyEncoderImpl();

        encoder.encode( "A", Collections.EMPTY_LIST );
        encoder.encode( "B", Arrays.asList( "A" ) );
        encoder.encode( "C", Arrays.asList( "A" ) );
        encoder.encode( "D", Arrays.asList( "B", "C" ) );
        encoder.encode( "E", Collections.EMPTY_LIST );

        System.out.println( encoder );
View Full Code Here

        HierarchyEncoderImpl encoder = new HierarchyEncoderImpl();

        encoder.encode( "A", Collections.EMPTY_LIST );
        encoder.encode( "B", Arrays.asList( "A" ) );
        encoder.encode( "C", Arrays.asList( "A" ) );
        encoder.encode( "D", Arrays.asList( "B", "C" ) );
        encoder.encode( "E", Collections.EMPTY_LIST );

        System.out.println( encoder );

        BitSet a = encoder.getCode( "A" );
View Full Code Here

        encoder.encode( "A", Collections.EMPTY_LIST );
        encoder.encode( "B", Arrays.asList( "A" ) );
        encoder.encode( "C", Arrays.asList( "A" ) );
        encoder.encode( "D", Arrays.asList( "B", "C" ) );
        encoder.encode( "E", Collections.EMPTY_LIST );

        System.out.println( encoder );

        BitSet a = encoder.getCode( "A" );
        BitSet b = encoder.getCode( "B" );
View Full Code Here

    @Test
    public void testHierALotOfClasses() {
        HierarchyEncoder encoder = new HierarchyEncoderImpl();
        int N = 1194;

        encoder.encode( "A", Collections.EMPTY_LIST );
        for ( int j = 1; j < N; j++ ) {
            encoder.encode( "X" + j, Arrays.asList( "A" ) );
        }

        assertEquals( N, encoder.size() );
View Full Code Here

        HierarchyEncoder encoder = new HierarchyEncoderImpl();
        int N = 1194;

        encoder.encode( "A", Collections.EMPTY_LIST );
        for ( int j = 1; j < N; j++ ) {
            encoder.encode( "X" + j, Arrays.asList( "A" ) );
        }

        assertEquals( N, encoder.size() );
        BitSet code = encoder.getCode( "X" + ( N -1 ) );
        assertEquals( 1, code.cardinality() );
View Full Code Here

    @Test
    public void testHierEncoderSimpleInheritance() {
        HierarchyEncoder encoder = new HierarchyEncoderImpl();

        encoder.encode( "A", Collections.EMPTY_LIST );
        encoder.encode( "B", Arrays.asList( "A" ) );
        encoder.encode( "C", Arrays.asList( "A" ) );
        encoder.encode( "D", Arrays.asList( "B" ) );
        encoder.encode( "E", Arrays.asList( "B" ) );
        encoder.encode( "F", Arrays.asList( "C" ) );
View Full Code Here

    @Test
    public void testHierEncoderSimpleInheritance() {
        HierarchyEncoder encoder = new HierarchyEncoderImpl();

        encoder.encode( "A", Collections.EMPTY_LIST );
        encoder.encode( "B", Arrays.asList( "A" ) );
        encoder.encode( "C", Arrays.asList( "A" ) );
        encoder.encode( "D", Arrays.asList( "B" ) );
        encoder.encode( "E", Arrays.asList( "B" ) );
        encoder.encode( "F", Arrays.asList( "C" ) );
        encoder.encode( "G", Arrays.asList( "C" ) );
View Full Code Here

    public void testHierEncoderSimpleInheritance() {
        HierarchyEncoder encoder = new HierarchyEncoderImpl();

        encoder.encode( "A", Collections.EMPTY_LIST );
        encoder.encode( "B", Arrays.asList( "A" ) );
        encoder.encode( "C", Arrays.asList( "A" ) );
        encoder.encode( "D", Arrays.asList( "B" ) );
        encoder.encode( "E", Arrays.asList( "B" ) );
        encoder.encode( "F", Arrays.asList( "C" ) );
        encoder.encode( "G", Arrays.asList( "C" ) );
View Full Code Here

        HierarchyEncoder encoder = new HierarchyEncoderImpl();

        encoder.encode( "A", Collections.EMPTY_LIST );
        encoder.encode( "B", Arrays.asList( "A" ) );
        encoder.encode( "C", Arrays.asList( "A" ) );
        encoder.encode( "D", Arrays.asList( "B" ) );
        encoder.encode( "E", Arrays.asList( "B" ) );
        encoder.encode( "F", Arrays.asList( "C" ) );
        encoder.encode( "G", Arrays.asList( "C" ) );

        System.out.println( encoder );
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.