@Override public final int weight(Tuple<NodeId> pattern) { for ( int i = 0 ; i < tupleLength ; i++ ) { NodeId X = colMap.fetchSlot(i, pattern) ; if ( undef(X) ) // End of fixed terms return i ; } return tupleLength ; }
@Test public void remap2() { ColumnMap x = new ColumnMap("SPO->POS", 2,0,1) ; Integer[] array = { 0,1,2 } ; assertEquals(Integer.valueOf(1), x.fetchSlot(0, array)) ; // The index 1 comes from position 0. assertEquals(Integer.valueOf(2), x.fetchSlot(1, array)) ; assertEquals(Integer.valueOf(0), x.fetchSlot(2, array)) ; }
@Test public void remap2() { ColumnMap x = new ColumnMap("SPO->POS", 2,0,1) ; Integer[] array = { 0,1,2 } ; assertEquals(Integer.valueOf(1), x.fetchSlot(0, array)) ; // The index 1 comes from position 0. assertEquals(Integer.valueOf(2), x.fetchSlot(1, array)) ; assertEquals(Integer.valueOf(0), x.fetchSlot(2, array)) ; }