Codota Logo
LinkedListEntry
Code IndexAdd Codota to your IDE (free)

How to use
LinkedListEntry
in
org.drools.core.util

Best Java code snippets using org.drools.core.util.LinkedListEntry (Showing top 12 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
StringBuilder s =
  • Codota Iconnew StringBuilder()
  • Codota Iconnew StringBuilder(32)
  • Codota IconString str;new StringBuilder(str)
  • Smart code suggestions by Codota
}
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.apache.servicemix.bundles/org.apache.servicemix.bundles.drools

public Activation[] getActivations() {
  Activation[] activations = new Activation[this.size];
  int j = 0;
  for ( LinkedList<LinkedListEntry<Activation>> list : array ) {
    if ( list != null ) {
      Iterator<LinkedListEntry<Activation>> it = list.iterator();
      Activation activation = it.next().getObject();
      while ( activation != null) {
        activations[j++] = activation;
        activation = it.next().getObject();
      }
    }
  }
  return activations;
}    
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 Activation getNext() {
  Activation activation = null;
  while ( this.index <= lastIndex ) {
    LinkedList<LinkedListEntry<Activation>> list = this.array[this.index];
    if ( list != null ) {
      activation = list.removeFirst().getObject();
      if ( list.isEmpty()) {
        this.array[this.index++] = null;
      }
      this.size--;
      break;
    }
    this.index++;
  }
  return activation;
}
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-reteoo

assertEquals( "value1", ((LogicalDependency) ((LinkedListEntry)bs.getFirst()).getObject()).getMode() );
assertEquals( "value2", ((LogicalDependency) ((LinkedListEntry)bs.getFirst().getNext()).getObject()).getMode() );
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.drools

/**
 * The FactHandle is being removed from the system so remove any logical dependencies
 * between the  justified FactHandle and its justifiers. Removes the FactHandle key
 * from the justifiedMap. It then iterates over all the LogicalDependency nodes, if any,
 * in the returned Set and removes the LogicalDependency node from the LinkedList maintained
 * by the Activation.
 *
 * @see LogicalDependency
 *
 * @param handle - The FactHandle to be removed
 * @throws FactException
 */
public void removeLogicalDependencies(final InternalFactHandle handle) throws FactException {
  final BeliefSet beliefSet = (BeliefSet) this.justifiedMap.remove( handle.getId() );
  if ( beliefSet != null && !beliefSet.isEmpty() ) {
    for ( LinkedListEntry entry = (LinkedListEntry) beliefSet.getFirst(); entry != null; entry = (LinkedListEntry) entry.getNext() ) {
      final LogicalDependency node = (LogicalDependency) entry.getObject();
      node.getJustifier().getLogicalDependencies().remove( node );
    }
  }
}    

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

public void unblockAllActivations(org.drools.runtime.rule.Activation act) {
  AgendaItem targetMatch = ( AgendaItem ) act;
  boolean wasBlocked = (targetMatch.getBlockers() != null && !targetMatch.getBlockers().isEmpty() );
  for ( LinkedListEntry entry = ( LinkedListEntry ) targetMatch.getBlockers().getFirst(); entry != null;  ) {
    LinkedListEntry tmp = ( LinkedListEntry ) entry.getNext();
    LogicalDependency dep = ( LogicalDependency ) entry.getObject();
    ((AgendaItem)dep.getJustifier()).removeBlocked( dep );
    entry = tmp;
  }
  if ( wasBlocked ) {
    // the match is no longer blocked, so stage it
    ((DefaultAgenda)workingMemory.getAgenda()).getStageActivationsGroup().addActivation( targetMatch );
  }
}
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 removeAllBlockersAndBlocked(DefaultAgenda agenda){
  if ( this.blockers != null ) {
    // Iterate and remove this node's logical dependency list from each of it's blockers
    for ( LinkedListEntry<LogicalDependency> node = blockers.getFirst(); node != null; node = node.getNext() ) {
      LogicalDependency dep = node.getObject();
      dep.getJustifier().getBlocked().remove( dep );                
    }
  }  
  this.blockers = null;
  
  if ( this.blocked != null ) {
    // Iterate and remove this node's logical dependency list from each of it's blocked
    for ( LogicalDependency dep = blocked.getFirst(); dep != null; ) {
      LogicalDependency tmp = dep.getNext();
      removeBlocked( dep );
      AgendaItem justified = ( AgendaItem ) dep.getJustified();
      if ( justified.getBlockers().isEmpty() && justified.isActivated() ) {
        // the match is no longer blocked, so stage it
        agenda.getStageActivationsGroup().addActivation( justified );
      }                
      dep = tmp;
    }
  }
  this.blocked = null;
}

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

for (LinkedListEntry node = (LinkedListEntry) list.getFirst(); node != null; node = (LinkedListEntry) node.getNext()) {
  LogicalDependency dependency = (LogicalDependency) node.getObject();
  org.drools.spi.Activation activation = dependency.getJustifier();
  ProtobufMessages.Activation _activation = ProtobufMessages.Activation.newBuilder()
org.drools.core.utilLinkedListEntry

Javadoc

The idea behind LinkedListNodeWrapper is to be able to add the same LinkedListNode to multiple LinkedLists where the node can have different previous and next nodes in each list.

Most used methods

  • getObject
  • getNext
  • <init>
  • getPrevious

Popular in Java

  • Finding current android device location
  • getSupportFragmentManager (FragmentActivity)
  • addToBackStack (FragmentTransaction)
  • orElseThrow (Optional)
  • InputStream (java.io)
    A readable source of bytes.Most clients will use input streams that read data from the file system (
  • Thread (java.lang)
    A thread is a thread of execution in a program. The Java Virtual Machine allows an application to ha
  • DateFormat (java.text)
    Formats or parses dates and times.This class provides factories for obtaining instances configured f
  • MessageFormat (java.text)
    MessageFormat provides a means to produce concatenated messages in language-neutral way. Use this to
  • Dictionary (java.util)
    The Dictionary class is the abstract parent of any class, such as Hashtable, which maps keys to valu
  • ServletException (javax.servlet)
    Defines a general exception a servlet can throw when it encounters difficulty.
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now