congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
ObjectHashMap.size
Code IndexAdd Tabnine to your IDE (free)

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

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

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

public int size() {
  return this.assertMap.size();
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.drools

public boolean isEmpty() {
  return this.assertMap.size() == 0;
}

origin: org.drools/drools-core

@Test
public void shouldLazilyAdd() throws Exception {
  final String fact1 = "logical";
  ksession.insert(fact1);
  assertEquals(
      "Shouldn't have anything, since no logical insert was performed.",
      0, tms.getEqualityKeyMap().size());
  final String fact2 = "logical";
  ksession.getTruthMaintenanceSystem().insert( fact2, null, null, new MockActivation() );
  assertEquals(
      "Now that a logical insert was done, it should have an element.",
      1, tms.getEqualityKeyMap().size());
  // Make sure the internals are fine.
  ObjectTypeConf typeConf = ksession.getObjectTypeConfigurationRegistry()
      .getObjectTypeConf(ksession.getEntryPoint(), fact1);
  assertTrue("Should have enabled TMS", typeConf.isTMSEnabled());
}
origin: org.drools/drools-compiler

  assertEquals( "assertMap should be empty",
         0,
         m.size() );
} finally {
  ksession.dispose();
origin: org.drools/drools-compiler

  assertEquals( "assertMap should be empty",
         0,
         m.size() );
} finally {
  ksession.dispose();
origin: org.drools/drools-core

       tms.getEqualityKeyMap().size() );
       tms.getEqualityKeyMap().size() );
key = tms.get( string );
assertSame( fz,
       tms.getEqualityKeyMap().size() );
key = tms.get( string );
       tms.getEqualityKeyMap().size() );
       tms.getEqualityKeyMap().size() );
key = tms.get( string );
assertSame( fd,
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.drools

public int size() {
  return (this.otherSinks != null ? this.otherSinks.size() : 0) + (this.hashableSinks != null ? this.hashableSinks.size() : 0) + (this.hashedSinkMap != null ? this.hashedSinkMap.size() : 0);
}
origin: org.drools/drools-compiler

assertEquals( 2, equalityMap.size() ); // go1, neg are two different strings.
org.drools.core.util.Iterator it = equalityMap.iterator();
EqualityKey key = ( EqualityKey  ) (( ObjectEntry ) it.next() ).getValue();
assertEquals( 0, getNegativeObjects(kSession).size() );
assertEquals( 0, key.getBeliefSet().size() );
assertEquals( 1, ep.getTruthMaintenanceSystem().getEqualityKeyMap().size() );
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.drools

@Override
protected void doVisit(NetworkNode node,
            Stack<NetworkNode> nodeStack,
            StatefulKnowledgeSessionInfo info) {
  RightInputAdapterNode an = (RightInputAdapterNode) node;
  DefaultNodeInfo ni = (DefaultNodeInfo) info.getNodeInfo( node );
  final ObjectHashMap memory = ((RIAMemory) info.getSession().getNodeMemory( an )).memory;
  
  ni.setMemoryEnabled( true );
  ni.setTupleMemorySize( memory.size() );
  ni.setCreatedFactHandles( memory.size() );
}
origin: org.drools/drools-compiler

assertEquals( 1, equalityMap.size() ); // Only Person type is logical
org.drools.core.util.Iterator it = equalityMap.iterator();
EqualityKey key = ( EqualityKey  ) (( ObjectEntry ) it.next() ).getValue();
origin: org.drools/drools-compiler

assertEquals( 1, equalityMap.size() ); // Only Person type is logical
org.drools.core.util.Iterator it = equalityMap.iterator();
EqualityKey key = ( EqualityKey  ) (( ObjectEntry ) it.next() ).getValue();
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.drools

public static void writeTruthMaintenanceSystem(MarshallerWriteContext context) throws IOException {
  ObjectOutputStream stream = context.stream;
  ObjectHashMap assertMap = context.wm.getTruthMaintenanceSystem().getAssertMap();
  EqualityKey[] keys = new EqualityKey[assertMap.size()];
  org.drools.core.util.Iterator it = assertMap.iterator();
  int i = 0;
  for ( org.drools.core.util.ObjectHashMap.ObjectEntry entry = (org.drools.core.util.ObjectHashMap.ObjectEntry) it.next(); entry != null; entry = (org.drools.core.util.ObjectHashMap.ObjectEntry) it.next() ) {
    EqualityKey key = (EqualityKey) entry.getKey();
    keys[i++] = key;
  }
  Arrays.sort( keys,
         EqualityKeySorter.instance );
  // write the assert map of Equality keys
  for ( EqualityKey key : keys ) {
    stream.writeShort( PersisterEnums.EQUALITY_KEY );
    stream.writeInt( key.getStatus() );
    InternalFactHandle handle = key.getFactHandle();
    stream.writeInt( handle.getId() );
    //context.out.println( "EqualityKey int:" + key.getStatus() + " int:" + handle.getId() );
    if ( key.getOtherFactHandle() != null && !key.getOtherFactHandle().isEmpty() ) {
      for ( InternalFactHandle handle2 : key.getOtherFactHandle() ) {
        stream.writeShort( PersisterEnums.FACT_HANDLE );
        stream.writeInt( handle2.getId() );
        //context.out.println( "OtherHandle int:" + handle2.getId() );
      }
    }
    stream.writeShort( PersisterEnums.END );
  }
  stream.writeShort( PersisterEnums.END );
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.drools

private void traverseHashedAlphaNodes(ObjectHashMap hashedAlphaNodes, NetworkHandler handler) {
  if (hashedAlphaNodes != null && hashedAlphaNodes.size() > 0) {
    AlphaNode firstAlpha = getFirstAlphaNode(hashedAlphaNodes);
    ClassFieldReader hashedFieldReader = getClassFieldReaderForHashedAlpha(firstAlpha);
    // start the hashed alphas
    handler.startHashedAlphaNodes(hashedFieldReader);
    Iterator iter = hashedAlphaNodes.iterator();
    for (ObjectHashMap.ObjectEntry entry = (ObjectHashMap.ObjectEntry) iter.next(); entry != null; entry = (ObjectHashMap.ObjectEntry) iter.next()) {
      CompositeObjectSinkAdapter.HashKey hashKey = (CompositeObjectSinkAdapter.HashKey) entry.getKey();
      AlphaNode alphaNode = (AlphaNode) entry.getValue();
      handler.startHashedAlphaNode(alphaNode, hashKey.getObjectValue());
      // traverse the propagator for each alpha
      traversePropagator(alphaNode.getSinkPropagator(), handler);
      handler.endHashedAlphaNode(alphaNode, hashKey.getObjectValue());
    }
    // end of the hashed alphas
    handler.endHashedAlphaNodes(hashedFieldReader);
  }
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.drools

EqualityKey[] keys = new EqualityKey[assertMap.size()];
org.drools.core.util.Iterator it = assertMap.iterator();
int i = 0;
origin: org.drools/drools-reteoo

       getLogicalCount( tms ) );
assertEquals( 1,
       tms.getEqualityKeyMap().size() );
       getLogicalCount( tms ) );
assertEquals( 0,
       tms.getEqualityKeyMap().size() );
org.drools.core.utilObjectHashMapsize

Popular methods of ObjectHashMap

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

Popular in Java

  • Parsing JSON documents to java classes using gson
  • requestLocationUpdates (LocationManager)
  • getSupportFragmentManager (FragmentActivity)
  • compareTo (BigDecimal)
  • FileInputStream (java.io)
    An input stream that reads bytes from a file. File file = ...finally if (in != null) in.clos
  • FileReader (java.io)
    A specialized Reader that reads from a file in the file system. All read requests made by calling me
  • ArrayList (java.util)
    ArrayList is an implementation of List, backed by an array. All optional operations including adding
  • LinkedList (java.util)
    Doubly-linked list implementation of the List and Dequeinterfaces. Implements all optional list oper
  • SortedMap (java.util)
    A map that has its keys ordered. The sorting is according to either the natural ordering of its keys
  • Scheduler (org.quartz)
    This is the main interface of a Quartz Scheduler. A Scheduler maintains a registry of org.quartz.Job
  • CodeWhisperer alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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