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

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

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

origin: org.drools/drools-core

@Test
public void testSize() {
  this.list.add( this.node1 );
  assertEquals( "LinkedList should have 1 node",
             this.list.size(),
             1 );
  this.list.add( this.node2 );
  assertEquals( "LinkedList should have 2 nodes",
             this.list.size(),
             2 );
  this.list.add( this.node3 );
  assertEquals( "LinkedList should have 3 nodes",
             this.list.size(),
             3 );
}
origin: org.drools/drools-core

  protected BetaNodeFieldConstraint[] convertToConstraints(LinkedList list) {
    final BetaNodeFieldConstraint[] array = new BetaNodeFieldConstraint[list.size()];
    int i = 0;
    for ( LinkedListEntry entry = (LinkedListEntry) list.getFirst(); entry != null; entry = (LinkedListEntry) entry.getNext() ) {
      array[i++] = (BetaNodeFieldConstraint) entry.getObject();
    }
    return array;
  }
}
origin: org.drools/drools-core

@Test
public void testClear() {
  this.list.add( this.node1 );
  this.list.add( this.node2 );
  this.list.add( this.node3 );
  assertEquals( "List size should be 3",
             this.list.size(),
             3 );
  this.list.clear();
  assertEquals( "Empty list should have size 0",
             this.list.size(),
             0 );
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.drools

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

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

public boolean equals(final Object object) {
  if ( object == this ) {
    return true;
  }
  if ( !(object instanceof LinkedList) ) {
    return false;
  }
  final LinkedList other = (LinkedList) object;
  if ( this.size() != other.size() ) {
    return false;
  }
  for ( LinkedListNode thisNode = this.firstNode, otherNode = other.firstNode; thisNode != null && otherNode != null; thisNode = thisNode.getNext(), otherNode = otherNode.getNext() ) {
    if ( !thisNode.equals( otherNode ) ) {
      return false;
    }
  }
  return true;
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.drools

public Activation[] getScheduledActivations() {
  Activation[] scheduledActivations = new Activation[this.scheduledActivations.size()];
  int i = 0;
  for ( ScheduledAgendaItem node = this.scheduledActivations.getFirst(); node != null; node = node.getNext() ) {
    scheduledActivations[i++] = node;
  }
  return scheduledActivations;
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.drools

public Activation[] getActivations() {
  Activation[] activations = new Activation[ list.size() ];
  final Iterator<ActivationNode> it = this.list.iterator();
  int i = 0;
  for ( ActivationNode node = it.next(); node != null; node = it.next() ) {
    activations[i++] =  node.getActivation();
  }        
  
  return activations;
}
origin: org.drools/drools-core

          this.node2 );
assertEquals( "LinkedList should have 3 nodes",
           this.list.size(),
           3 );
assertSame( "First node should be node1",
origin: org.drools/drools-reteoo

assertEquals( 2, item1.getBlocked().size() );
assertEquals( 1, item2.getBlockers().size() );
assertEquals( 1, item3.getBlockers().size() );
assertEquals( 2, item1.getBlocked().size() );
assertEquals( 1, item2.getBlocked().size() );
assertEquals( 1, item2.getBlockers().size() );
assertEquals( 2, item3.getBlockers().size() );        
origin: org.drools/drools-reteoo

assertEquals( 0, item3.getBlockers().size() );
assertNull( item3.getBlocked() );
assertEquals( 0, item2.getBlocked().size() );
assertNull( item2.getBlockers() );
assertEquals( 0, item1.getBlocked().size() );
assertEquals( 0, item1.getBlocked().size() );              
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.drools

public void blockActivation(org.drools.runtime.rule.Activation act) {
  AgendaItem targetMatch = ( AgendaItem ) act;
  // iterate to find previous equal logical insertion
  LogicalDependency dep = null;
  if ( this.previousJustified != null ) {
    for ( dep = this.previousJustified.getFirst(); dep != null; dep = dep.getNext() ) {
      if ( targetMatch ==  dep.getJustified() ) {
        this.previousJustified.remove( dep );
        break;
      }
    }
  }
  if ( dep == null ) {
    dep = new SimpleLogicalDependency( activation, targetMatch );
  }
  this.activation.addBlocked(  dep );
  if ( targetMatch.getBlockers().size() == 1 && targetMatch.isActive()  ) {
    // it wasn't blocked before, but is now, so we must remove it from all groups, so it cannot be executed.
    targetMatch.remove();
    if ( targetMatch.getActivationGroupNode() != null ) {
      targetMatch.getActivationGroupNode().getActivationGroup().removeActivation( targetMatch );
    }
    if ( targetMatch.getActivationNode() != null ) {
      final InternalRuleFlowGroup ruleFlowGroup = (InternalRuleFlowGroup) targetMatch.getActivationNode().getParentContainer();
      ruleFlowGroup.removeActivation( targetMatch );
    }
  }
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.drools

if ( activation.isCanceled() || ( activation.getBlockers() != null && activation.getBlockers().size() > 0 ) ) {
origin: org.drools/drools-reteoo

assertEquals( 1, item1.getBlocked().size() );
assertEquals( item4, ((LogicalDependency)item1.getBlocked().getFirst()).getJustified() );
assertEquals( 0, item2.getBlockers().size() );
assertEquals( 0, item3.getBlockers().size() );
assertEquals( 1, item4.getBlockers().size() );
origin: org.drools/drools-reteoo

assertEquals( 0, item2.getBlockers().size() );        
assertEquals( 1, item2.getBlocked().size() );
assertEquals(1, item3.getBlockers().size());
assertNull(item3.getBlocked());
assertSame( item2, ((LogicalDependency)item2.getBlocked().getFirst()).getJustifier() );
assertEquals( 0, item3.getBlockers().size() );
assertNull( item3.getBlocked() );
assertEquals( 1, item2.getBlocked().size() );
assertEquals(1, item3.getBlockers().size());
assertNull(item3.getBlocked());
assertSame( item2, ((LogicalDependency)item2.getBlocked().getFirst()).getJustifier() );
assertNull( item3.getBlocked() );
assertEquals( 0, item2.getBlocked().size() );
assertNull( item2.getBlockers() );
org.drools.core.utilLinkedListsize

Popular methods of LinkedList

  • getFirst
    Return the first node in the list
  • <init>
    Construct an empty LinkedList
  • add
    Add a LinkedListNode to the list. If the LinkedList is empty then the first and last nodes are set t
  • clear
    Iterates the list removing all the nodes until there are no more nodes to remove.
  • isEmpty
  • remove
    Removes a LinkedListNode from the list. This works by attach the previous reference to the child ref
  • removeFirst
    Remove the first node from the list. The next node then becomes the first node. If this is the last
  • removeLast
    Remove the last node from the list. The previous node then becomes the last node. If this is the las
  • get
  • getLast
    Return the last node in the list
  • insertAfter
  • iterator
  • insertAfter,
  • iterator,
  • javaUtilIterator

Popular in Java

  • Running tasks concurrently on multiple threads
  • getSystemService (Context)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • compareTo (BigDecimal)
  • HttpServer (com.sun.net.httpserver)
    This class implements a simple HTTP server. A HttpServer is bound to an IP address and port number a
  • BufferedInputStream (java.io)
    A BufferedInputStream adds functionality to another input stream-namely, the ability to buffer the i
  • URL (java.net)
    A Uniform Resource Locator that identifies the location of an Internet resource as specified by RFC
  • Connection (java.sql)
    A connection represents a link from a Java application to a database. All SQL statements and results
  • HashMap (java.util)
    HashMap is an implementation of Map. All optional operations are supported.All elements are permitte
  • Manifest (java.util.jar)
    The Manifest class is used to obtain attribute information for a JarFile and its entries.
  • Top 17 Plugins for Android Studio
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