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

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

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

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.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

@Test
public void testGetFirst() {
  assertNull( "Empty list should return null on getFirst()",
            this.list.getFirst() );
  this.list.add( this.node1 );
  assertSame( "List should return node1 on getFirst()",
            this.list.getFirst(),
            this.node1 );
  this.list.add( this.node2 );
  assertSame( "List should return node1 on getFirst()",
            this.list.getFirst(),
            this.node1 );
  this.list.add( this.node3 );
  assertSame( "List should return node1 on getFirst()",
            this.list.getFirst(),
            this.node1 );
}
origin: org.drools/drools-core

@Test
public void testGetLast() {
  assertNull( "Empty list should return null on getLast()",
            this.list.getLast() );
  this.list.add( this.node1 );
  assertSame( "List should return node1 on getLast()",
            this.list.getLast(),
            this.node1 );
  this.list.add( this.node2 );
  assertSame( "List should return node2 on getLast()",
            this.list.getLast(),
            this.node2 );
  this.list.add( this.node3 );
  assertSame( "List should return node3 on getLast()",
            this.list.getLast(),
            this.node3 );
}
origin: org.drools/drools-core

@Test
public void testIsEmpty() {
  assertTrue( "Empty list should return true on isEmpty()",
            this.list.isEmpty() );
  this.list.add( this.node1 );
  assertFalse( "Not empty list should return false on isEmpty()",
            this.list.isEmpty() );
}
origin: org.drools/drools-core

@Test
public void testRemoveFirst() {
  this.list.add( this.node1 );
  this.list.add( this.node2 );
  this.list.add( this.node3 );
  assertSame( "List should return node1 on getFirst()",
            this.list.getFirst(),
            this.node1 );
  this.list.removeFirst();
  assertSame( "List should return node2 on getFirst()",
            this.list.getFirst(),
            this.node2 );
  this.list.removeFirst();
  assertSame( "List should return node3 on getFirst()",
            this.list.getFirst(),
            this.node3 );
  this.list.removeFirst();
  assertNull( "Empty list should return null on getFirst()",
            this.list.getFirst() );
}
origin: org.drools/drools-core

@Test
public void testRemoveLast() {
  this.list.add( this.node1 );
  this.list.add( this.node2 );
  this.list.add( this.node3 );
  assertSame( "List should return node1 on getLast()",
            this.list.getLast(),
            this.node3 );
  this.list.removeLast();
  assertSame( "List should return node2 on getLast()",
            this.list.getLast(),
            this.node2 );
  this.list.removeLast();
  assertSame( "List should return node3 on getLast()",
            this.list.getLast(),
            this.node1 );
  this.list.removeLast();
  assertNull( "Empty list should return null on getLast()",
            this.list.getLast() );
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.drools

public void addLogicalDependency(final LogicalDependency node) {
  if ( this.justified == null ) {
    this.justified = new LinkedList<LogicalDependency>();
  }
  this.justified.add( node );
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.drools

public void addActivation(final Activation activation) {
  final ActivationGroupNode node = new ActivationGroupNode( activation,
                               this );
  activation.setActivationGroupNode( node );
  this.list.add( node );
}
origin: org.drools/drools-core

@Test
public void testRemove() {
  this.list.add( this.node1 );
  this.list.add( this.node2 );
  this.list.add( this.node3 );
origin: org.drools/drools-core

@Test
public void testAdd() {
  this.list.add( this.node1 );
  assertNull( "Node1 previous should be null",
            this.node1.getPrevious() );
            this.node1 );
  this.list.add( this.node2 );
  assertSame( "node1 next should be node2",
            this.node1.getNext(),
            this.node2 );
  this.list.add( this.node3 );
  assertSame( "node2 next should be node3",
            this.node2.getNext(),
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.drools

fieldIndex = new FieldIndex( index,
               fieldExtractor );
this.hashedFieldIndexes.add( fieldIndex );
fieldIndex = new FieldIndex( index,
               fieldExtractor );
this.hashedFieldIndexes.add( fieldIndex );
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.drools

public void addBlocked(final LogicalDependency dep) {
  // Adds the blocked to the blockers list
  if ( this.blocked == null ) {
    this.blocked = new LinkedList<LogicalDependency>();
  }
  this.blocked.add( dep );
  // now ad the blocker to the blocked's list - we need to check that references are null first
  AgendaItem blocked = (AgendaItem)dep.getJustified();
  if ( blocked.blockers == null ) {
    blocked.blockers = new LinkedList<LinkedListEntry<LogicalDependency>>();
    blocked.blockers.add( dep.getJustifierEntry() );
  } else if ( dep.getJustifierEntry().getNext() == null && dep.getJustifierEntry().getPrevious() == null && blocked.getBlockers().getFirst() != dep.getJustifierEntry() ) {
    blocked.blockers.add( dep.getJustifierEntry() );
  }
}

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

public void add(final Activation activation) {
  AgendaItem item = (AgendaItem) activation;
  this.size++;
  int seq = item.getSequenence();
  if ( seq < this.index ) {
    this.index = seq;
  }
  if ( seq > this.lastIndex ) {
    this.lastIndex = seq;
  }
  LinkedList<LinkedListEntry<Activation>> list = this.array[seq];
  if ( list == null ) {
    list = new LinkedList<LinkedListEntry<Activation>>();
    this.array[item.getSequenence()] = list;
  }
  list.add( new LinkedListEntry<Activation>( activation ) );
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.drools

public void addActivation(final Activation activation) {
  assert activation.getActivationNode() == null;
  final ActivationNode node = new ActivationNode( activation,
                          this );
  activation.setActivationNode( node );
  this.list.add( node );
  if ( this.active ) {
    ((InternalAgendaGroup) activation.getAgendaGroup()).add( activation );
  }
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.drools

/**
 * Schedule an agenda item for delayed firing.
 * 
 * @param item
 *            The item to schedule.
 */
public void scheduleItem(final ScheduledAgendaItem item, final InternalWorkingMemory wm) {
  this.scheduledActivations.add( item );
  item.setEnqueued( true );
  if( item.getPropagationContext().getReaderContext() == null ) {
    // this is not a serialization propagation, so schedule it
    // otherwise the timer will be correlated with this activation later during the 
    // deserialization of timers
    Scheduler.scheduleAgendaItem( item,
                   this,
                   wm );
  }
}
org.drools.core.utilLinkedListadd

Javadoc

Add a LinkedListNode to the list. If the LinkedList is empty then the first and last nodes are set to the added node.

Popular methods of LinkedList

  • getFirst
    Return the first node in the list
  • size
  • <init>
    Construct an empty LinkedList
  • 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
  • getApplicationContext (Context)
  • setRequestProperty (URLConnection)
  • compareTo (BigDecimal)
  • Font (java.awt)
    The Font class represents fonts, which are used to render text in a visible way. A font provides the
  • SocketException (java.net)
    This SocketException may be thrown during socket creation or setting options, and is the superclass
  • Format (java.text)
    The base class for all formats. This is an abstract base class which specifies the protocol for clas
  • Properties (java.util)
    A Properties object is a Hashtable where the keys and values must be Strings. Each property can have
  • ResourceBundle (java.util)
    ResourceBundle is an abstract class which is the superclass of classes which provide Locale-specifi
  • Callable (java.util.concurrent)
    A task that returns a result and may throw an exception. Implementors define a single method with no
  • 14 Best Plugins for Eclipse
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