public void assertObject(final InternalFactHandle factHandle, final PropagationContext context, final InternalWorkingMemory workingMemory) { new RightTupleImpl( factHandle, this ); this.asserted.add( new Object[]{factHandle, context, workingMemory} ); }
private RightTuple newRightTuple(int id, Object object) { return new RightTupleImpl( new DefaultFactHandle( id, object ), null ); }
public RightBuilder insert(Object... objects) { for (Object object : objects) { InternalFactHandle fh = (InternalFactHandle) wm.insert(object); RightTuple rightTuple = new RightTupleImpl( fh, sink ); rightTuple.setPropagationContext( new PhreakPropagationContext() ); rightTuples.addInsert( rightTuple ); } return this; }
public List<RightTuple> getRightTuples(Object... objects) { BetaNode node = scenario.getBetaNode(); BetaMemory bm = scenario.getBm(); TupleMemory rtm = bm.getRightTupleMemory(); InternalWorkingMemory wm = scenario.getWorkingMemory(); if ( objects == null ) { objects = new Object[0]; } List<RightTuple> rightTuples = new ArrayList<RightTuple>(); for ( Object object : objects ) { InternalFactHandle fh = (InternalFactHandle) wm.insert( object ); RightTuple expectedRightTuple = new RightTupleImpl( fh, node ); //node.createLeftTuple( fh, node, true ); expectedRightTuple.setPropagationContext( new PhreakPropagationContext() ); rightTuples.add( expectedRightTuple ); } scenario.setTestRightMemory( true ); return rightTuples; }
table[0] = rtList; for ( int i = 0; i < numEntries; i++ ) { RightTuple rightTuple = new RightTupleImpl(); rightTuple.setMemory( rtList ); rtList.add( rightTuple ); table[2] = rtList; for ( int i = 0; i < numEntries; i++ ) { RightTuple rightTuple = new RightTupleImpl(); rightTuple.setMemory( rtList ); rtList.add( rightTuple ); table[2].setNext( rtList ); for ( int i = 0; i < numEntries; i++ ) { RightTuple rightTuple = new RightTupleImpl(); rightTuple.setMemory( rtList ); rtList.add( rightTuple );
InternalFactHandle fh13 = (InternalFactHandle) ss.insert( new Foo( "snicker", 0) ); betaMemory.getRightTupleMemory().add( new RightTupleImpl( fh1, null ) ); betaMemory.getRightTupleMemory().add( new RightTupleImpl( fh2, null ) ); betaMemory.getRightTupleMemory().add( new RightTupleImpl( fh3, null ) ); betaMemory.getRightTupleMemory().add( new RightTupleImpl( fh4, null ) ); betaMemory.getRightTupleMemory().add( new RightTupleImpl( fh5, null ) ); betaMemory.getRightTupleMemory().add( new RightTupleImpl( fh6, null ) ); betaMemory.getRightTupleMemory().add( new RightTupleImpl( fh7, null ) ); betaMemory.getRightTupleMemory().add( new RightTupleImpl( fh8, null ) ); betaMemory.getRightTupleMemory().add( new RightTupleImpl( fh9, null ) ); rightTupleList.add( new RightTupleImpl( fh10, null) ); hashTable.getTable()[0] = rightTupleList; rightTupleList = new TupleList(); rightTupleList.add( new RightTupleImpl( fh11, null ) ); rightTupleList.add( new RightTupleImpl( fh12, null ) ); rightTupleList.add( new RightTupleImpl( fh13, null ) ); ((TupleList)hashTable.getTable()[0]).setNext( rightTupleList );
1 ); Tuple tuple = new RightTupleImpl( new DefaultFactHandle( 1, new Cheese("stilton", 10) ) ); final TupleList index = new AbstractHashTable.SingleIndexTupleList( singleIndex, tuple, "stilton".hashCode(), false ); RightTuple h1RightTuple = new RightTupleImpl( h1, null ); index.add( h1RightTuple ); final Tuple entry2 = index.get( new RightTupleImpl( h1, null ) ); assertSame( entry1, entry2 );
public T delete(Object... objects) { this.testStagedDelete = true; if ( objects == null ) { objects = new Object[0]; } for ( int i = 0; i < objects.length; i++ ) { if ( !(objects[i] instanceof Pair) ) { Object o1 = objects[i]; InternalFactHandle fh1 = (InternalFactHandle) wm.getFactHandle( o1 ); LeftTuple leftTuple = new LeftTupleImpl( fh1, sink, true ); leftTuples.addDelete( leftTuple ); } else { Pair p = (Pair )objects[i]; InternalFactHandle fh1 = (InternalFactHandle) wm.getFactHandle( p.getO1() ); LeftTuple leftTuple1 = new LeftTupleImpl( fh1, sink, true ); InternalFactHandle fh2 = (InternalFactHandle) wm.getFactHandle( p.getO2() ); LeftTuple leftTuple2 = sink.createLeftTuple( leftTuple1, new RightTupleImpl( fh2 ), sink ); leftTuples.addDelete( leftTuple2 ); } } return (T) this ; }
public T update(Object... objects) { this.testStagedUpdate = true; if ( objects == null ) { objects = new Object[0]; } for ( int i = 0; i < objects.length; i++ ) { if ( !(objects[i] instanceof Pair) ) { Object o1 = objects[i]; InternalFactHandle fh1 = (InternalFactHandle) wm.getFactHandle( o1 ); LeftTuple leftTuple = new LeftTupleImpl( fh1, sink, true ); leftTuples.addUpdate( leftTuple ); } else { Pair p = (Pair )objects[i]; InternalFactHandle fh1 = (InternalFactHandle) wm.getFactHandle( p.getO1() ); LeftTuple leftTuple1 = new LeftTupleImpl( fh1, sink, true ); InternalFactHandle fh2 = (InternalFactHandle) wm.getFactHandle( p.getO2() ); LeftTuple leftTuple2 = sink.createLeftTuple( leftTuple1, new RightTupleImpl( fh2 ), sink ); leftTuples.addUpdate( leftTuple2 ); } } return (T) this ; }
public T insert(Object... objects) { this.testStagedInsert = true; if ( objects == null ) { objects = new Object[0]; } for ( int i = 0; i < objects.length; i++ ) { if ( !(objects[i] instanceof Pair) ) { Object o1 = objects[i]; InternalFactHandle fh1 = (InternalFactHandle) wm.getFactHandle( o1 ); LeftTuple leftTuple = new LeftTupleImpl( fh1, sink, true ); leftTuples.addInsert( leftTuple ); } else { Pair p = (Pair )objects[i]; InternalFactHandle fh1 = (InternalFactHandle) wm.getFactHandle( p.getO1() ); LeftTuple leftTuple1 = new LeftTupleImpl( fh1, sink, true ); InternalFactHandle fh2 = (InternalFactHandle) wm.getFactHandle( p.getO2() ); LeftTuple leftTuple2 = sink.createLeftTuple( leftTuple1, new RightTupleImpl( fh2 ), sink ); leftTuples.addInsert( leftTuple2 ); } } return (T) this ; }
final InternalFactHandle stiltonHandle1 = new DefaultFactHandle( 1, stilton1 ); map.add( new RightTupleImpl( stiltonHandle1, null ) ); final InternalFactHandle cheddarHandle1 = new DefaultFactHandle( 2, cheddar1 ); map.add( new RightTupleImpl( cheddarHandle1, null ) ); final InternalFactHandle stiltonHandle2 = new DefaultFactHandle( 3, stilton2 ); map.add( new RightTupleImpl( stiltonHandle2, null ) );
1 ); Tuple tuple = new RightTupleImpl( new DefaultFactHandle( 1, new Cheese("stilton", 10) ) ); final TupleList index = new AbstractHashTable.SingleIndexTupleList( singleIndex, tuple, "stilton".hashCode(), false ); stilton2 ); RightTuple h1RightTuple = new RightTupleImpl( h1, null ); RightTuple h2RightTuple = new RightTupleImpl( h2, null );
new RightTupleImpl( f1, null ), null, true );
final InternalFactHandle stiltonHandle1 = new DefaultFactHandle( 1, stilton1 ); RightTuple stiltonRightTuple1 = new RightTupleImpl( stiltonHandle1, null ); map.add( stiltonRightTuple1 ); final InternalFactHandle cheddarHandle1 = new DefaultFactHandle( 2, cheddar1 ); RightTuple cheddarRightTuple1 = new RightTupleImpl( cheddarHandle1, null ); map.add( cheddarRightTuple1 ); final InternalFactHandle stiltonHandle2 = new DefaultFactHandle( 3, stilton2 ); RightTuple stiltonRightTuple2 = new RightTupleImpl( stiltonHandle2, null ); map.add( stiltonRightTuple2 );
1 ); Tuple tuple = new RightTupleImpl( new DefaultFactHandle( 1, new Cheese("stilton", 10) ) ); final TupleList index = new AbstractHashTable.SingleIndexTupleList( singleIndex, tuple, "stilton".hashCode(), false ); stilton3 ); RightTuple h1RightTuple = new RightTupleImpl( h1, null ); RightTuple h2RightTuple = new RightTupleImpl( h2, null ); RightTuple h3RightTuple = new RightTupleImpl( h3, null );
final InternalFactHandle stiltonHandle1 = new DefaultFactHandle( 1, stilton1 ); map.add( new RightTupleImpl( stiltonHandle1, null ) ); final InternalFactHandle cheddarHandle1 = new DefaultFactHandle( 2, cheddar1 ); map.add( new RightTupleImpl( cheddarHandle1, null ) );
c1 ); map.add( new RightTupleImpl( ch1, null ) ); final InternalFactHandle ch2 = new DefaultFactHandle( 2, c2 ); map.add( new RightTupleImpl( ch2, null ) );
RightTuple stiltonRighTuple = new RightTupleImpl( new DefaultFactHandle( 1, stilton1 ), null );
rule1, (Activation) tuple1.getContextObject() ); new RightTupleImpl( logicalHandle, sink ); context1.setFactHandle( handle1 ); (Activation) tuple1.getContextObject() ); new RightTupleImpl( logicalHandle, sink );
rule1, (Activation) tuple1.getContextObject() ); new RightTupleImpl( logicalHandle1, sink );