congrats Icon
New! Announcing our next generation AI code completions
Read here
Tabnine Logo
ObjectHashMap.get
Code IndexAdd Tabnine to your IDE (free)

How to use
get
method
in
org.drools.core.util.ObjectHashMap

Best Java code snippets using org.drools.core.util.ObjectHashMap.get (Showing top 20 results out of 315)

origin: org.drools/drools-core

@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)) );
}
origin: org.drools/drools-core

@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 ) );
  }
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.drools

public InternalFactHandle getHandleForObject(Object object){
  if ( object == null ) {
    return null;
  } else {
    return (InternalFactHandle) this.assertMap.get( object );
  }
}

origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.drools

public EqualityKey get(final EqualityKey key) {
  return (EqualityKey) this.assertMap.get( key );
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.drools

public InternalFactHandle reconnect(FactHandle factHandle) {
  return (InternalFactHandle) this.assertMap.get( factHandle );
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.drools

public InternalFactHandle getHandleForObjectIdentity(Object object) {
  return (InternalFactHandle) this.identityMap.get( object );
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.drools

public EqualityKey get(final Object object) {
  return (EqualityKey) this.assertMap.get( object );
}
origin: org.drools/drools-core

@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 ) );
  }
}
origin: org.drools/drools-core

@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 ) );
  }
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.drools

public Object getObjectForHandle(FactHandle handle) {
  try {
    this.lock.lock();
    // Make sure the FactHandle is from this WorkingMemory
    final InternalFactHandle internalHandle = (InternalFactHandle) this.assertMap.get( handle );
    if ( internalHandle == null ) {
      return null;
    }
    Object object = internalHandle.getObject();
    return object;
  } finally {
    this.lock.unlock();
  }
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.drools

public void removeLogicalDependency(final Activation activation,
                  final LogicalDependency node,
                  final PropagationContext context) {
  final InternalFactHandle handle = (InternalFactHandle) node.getJustified();
  final BeliefSet beliefSet = (BeliefSet) this.justifiedMap.get( handle.getId() );
  
  if ( beliefSet != null ) {
    beliefSystem.delete( node, beliefSet, context );
  }
}    
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.drools

public void modifyLeftTuple(LeftTuple leftTuple,
              PropagationContext context,
              InternalWorkingMemory workingMemory) {
  final RIAMemory memory = (RIAMemory) workingMemory.getNodeMemory( this );
  // add it to a memory mapping
  InternalFactHandle handle = (InternalFactHandle) memory.memory.get( leftTuple );
  // propagate it
  for ( RightTuple rightTuple = handle.getFirstRightTuple(); rightTuple != null; rightTuple = (RightTuple) rightTuple.getHandleNext() ) {
    rightTuple.getRightTupleSink().modifyRightTuple( rightTuple,
                             context,
                             workingMemory );
  }
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.drools

public LogicalRetractCallback(MarshallerReaderContext context) throws IOException {
  this.tms = context.wm.getTruthMaintenanceSystem();
  this.handle = context.handles.get( context.readInt() );
  this.context = context.propagationContexts.get( context.readLong() );
  this.activation = (Activation) context.terminalTupleMap.get( context.readInt() ).getObject();
  this.beliefSet = (BeliefSet) this.tms.getJustifiedMap().get( handle.getId() );
  for ( LinkedListEntry entry = (LinkedListEntry) beliefSet.getFirst(); entry != null; entry = (LinkedListEntry) entry.getNext() ) {
    final LogicalDependency node = (LogicalDependency) entry.getObject();
    if ( node.getJustifier() == this.activation ) {
      this.node = node;
      break;
    }
  }
}
origin: org.drools/drools-core

         cheese,
         extractor );
ObjectSink sink = (ObjectSink) ad.hashedSinkMap.get( hashKey );
assertSame( al2,
      sink );
         cheese,
         extractor );
sink = (ObjectSink) ad.hashedSinkMap.get( hashKey );
assertNull( sink );
origin: org.drools/drools-core

         cheese,
         extractor );
ObjectSink sink = (ObjectSink) ad.hashedSinkMap.get( hashKey );
assertSame( al2,
      sink );
         cheese,
         extractor );
sink = (ObjectSink) ad.hashedSinkMap.get( hashKey );
assertNull( sink );
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.drools

public LogicalRetractCallback(MarshallerReaderContext context,
               Action _action) {
  LogicalRetract _retract = _action.getLogicalRetract();
  this.tms = context.wm.getTruthMaintenanceSystem();
  this.handle = context.handles.get( _retract.getHandleId() );
  this.activation = (Activation) context.filter
                     .getTuplesCache().get( PersisterHelper.createActivationKey( _retract.getActivation().getPackageName(),
                                                   _retract.getActivation().getRuleName(),
                                                   _retract.getActivation().getTuple() ) ).getObject();
  this.context = this.activation.getPropagationContext();
  this.beliefSet = (BeliefSet) this.tms.getJustifiedMap().get( handle.getId() );
  for ( LinkedListEntry entry = (LinkedListEntry) beliefSet.getFirst(); entry != null; entry = (LinkedListEntry) entry.getNext() ) {
    final LogicalDependency node = (LogicalDependency) entry.getObject();
    if ( node.getJustifier() == this.activation ) {
      this.node = node;
      break;
    }
  }
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.drools

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 );
  }
}   
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.drools

                   object,
                   fieldIndex.getFieldExtractor() );
final AlphaNode sink = (AlphaNode) this.hashedSinkMap.get( hashKey );
if ( sink != null ) {
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.drools

                   object,
                   fieldIndex.getFieldExtractor() );
final AlphaNode sink = (AlphaNode) this.hashedSinkMap.get( hashKey );
if ( sink != null ) {
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.drools

                   object,
                   fieldIndex.getFieldExtractor() );
final AlphaNode sink = (AlphaNode) this.hashedSinkMap.get( hashKey );
if ( sink != null ) {
org.drools.core.utilObjectHashMapget

Popular methods of ObjectHashMap

  • iterator
  • size
  • <init>
  • isEmpty
  • put
  • clear
  • indexOf
  • newIterator
  • remove
  • resize
  • setComparator
  • setComparator

Popular in Java

  • Reading from database using SQL prepared statement
  • runOnUiThread (Activity)
  • startActivity (Activity)
  • requestLocationUpdates (LocationManager)
  • Window (java.awt)
    A Window object is a top-level window with no borders and no menubar. The default layout for a windo
  • BufferedImage (java.awt.image)
    The BufferedImage subclass describes an java.awt.Image with an accessible buffer of image data. All
  • FileInputStream (java.io)
    An input stream that reads bytes from a file. File file = ...finally if (in != null) in.clos
  • Collection (java.util)
    Collection is the root of the collection hierarchy. It defines operations on data collections and t
  • DataSource (javax.sql)
    An interface for the creation of Connection objects which represent a connection to a database. This
  • JList (javax.swing)
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now