@Test public void testStringData2() { final int count = 100000; final ObjectHashMap map = new ObjectHashMap(); assertNotNull( map ); final long start = System.currentTimeMillis(); for ( int idx = 0; idx < count; idx++ ) { final String key = "key" + idx; final String strval = "value" + idx; map.put( key, strval ); } final long end = System.currentTimeMillis(); System.out.println( "Custom ObjectHashMap put(key,value) ET - " + ((end - start)) ); }
@Test public void testStringData5() { final int count = 100000; final ObjectHashMap map = new ObjectHashMap(); assertNotNull( map ); final long start = System.currentTimeMillis(); for ( int idx = 0; idx < count; idx++ ) { final String key = "key" + idx; final String strval = "value" + idx; map.put( key, strval, false ); } final long end = System.currentTimeMillis(); System.out.println( "Custom ObjectHashMap dup false ET - " + ((end - start)) ); } }
@Test public void testStringData3() { final int count = 100000; final ObjectHashMap map = new ObjectHashMap(); assertNotNull( map ); for ( int idx = 0; idx < count; idx++ ) { final String key = "key" + idx; final String strval = "value" + idx; map.put( key, strval ); } final long start = System.currentTimeMillis(); for ( int idx = 0; idx < count; idx++ ) { final String key = "key" + idx; map.get( key ); } final long end = System.currentTimeMillis(); System.out.println( "Custom ObjectHashMap get(key) ET - " + ((end - start)) ); }
@Test public void testStringData4() { final int count = 100000; final ObjectHashMap map = new ObjectHashMap(); assertNotNull( map ); for ( int idx = 0; idx < count; idx++ ) { final String key = "key" + idx; final String strval = "value" + idx; map.put( key, strval ); } final long start = System.currentTimeMillis(); final org.drools.core.util.Iterator itr = map.iterator(); Object val = null; while ( (val = itr.next()) != null ) { val.hashCode(); } final long end = System.currentTimeMillis(); System.out.println( "Custom ObjectHashMap iterate ET - " + ((end - start)) ); }
@Test public void testIntegerData() { final ObjectHashMap map = new ObjectHashMap(); assertNotNull( map ); final int count = 1000; for ( int idx = 0; idx < count; idx++ ) { final Integer key = new Integer( idx ); final Integer val = new Integer( idx ); map.put( key, val ); assertEquals( val, map.get( key ) ); } }
public Object put(final Object key, final Object value) { return put( key, value, true ); }
public Object put(final EqualityKey key) { return this.assertMap.put( key, key, false ); }
@Test public void testStringData() { final ObjectHashMap map = new ObjectHashMap(); assertNotNull( map ); final int count = 1000; for ( int idx = 0; idx < count; idx++ ) { final String key = "key" + idx; final String val = "value" + idx; map.put( key, val ); assertEquals( val, map.get( key ) ); } }
@Test public void testStringDataDupFalse() { final ObjectHashMap map = new ObjectHashMap(); assertNotNull( map ); final int count = 10000; for ( int idx = 0; idx < count; idx++ ) { final String key = "key" + idx; final String val = "value" + idx; map.put( key, val, false ); assertEquals( val, map.get( key ) ); } }
public void updateHandle(InternalFactHandle handle, Object object){ this.assertMap.remove( handle ); Object oldObject = handle.getObject(); handle.setObject( object ); this.assertMap.put( handle, handle, false ); }
memory.events.put(factHandle, list); this.sink.propagateAssertObject(factHandle,
final RIAMemory memory = (RIAMemory) workingMemory.getNodeMemory( this ); memory.memory.put( leftTuple, handle );
list = new WindowTupleList((EventFactHandle) factHandle, this); context.setActiveWindowTupleList(list); memory.events.put(factHandle, list); this.sink.propagateAssertObject(factHandle,
context.wm.getEntryPoints().get( EntryPoint.DEFAULT.getEntryPointId() ), false ); memory.put( parentLeftTuple, handle );
public void addLogicalDependency(final InternalFactHandle handle, final Object value, final Activation activation, final PropagationContext context, final Rule rule, final ObjectTypeConf typeConf, final boolean read) throws FactException { final LogicalDependency node = beliefSystem.newLogicalDependency( activation, handle, value ); activation.getRule().setHasLogicalDependency( true ); activation.addLogicalDependency( node ); BeliefSet beliefSet = (BeliefSet) this.justifiedMap.get( handle.getId() ); if ( beliefSet == null ) { if ( context.getType() == PropagationContext.MODIFICATION ) { // if this was a update, chances are its trying to retract a logical assertion } beliefSet = beliefSystem.newBeliefSet(); this.justifiedMap.put( handle.getId(), beliefSet ); } if ( read ) { // used when deserialising beliefSystem.read( node, beliefSet, context, typeConf ); } else { beliefSystem.insert( node, beliefSet, context, typeConf ); } }
this.hashedSinkMap.put( new HashKey( index, value, fieldReader ),
this.hashedSinkMap.put( new HashKey( index, value, fieldIndex.getFieldExtractor() ),