Knowledge API Legacy5 Adapter 6.1.0.Final

org.drools.impl.adapters
Class WorkingMemoryEntryPointAdapter

java.lang.Object
  extended by org.drools.impl.adapters.WorkingMemoryEntryPointAdapter
All Implemented Interfaces:
WorkingMemoryEntryPoint

public class WorkingMemoryEntryPointAdapter
extends Object
implements WorkingMemoryEntryPoint


Constructor Summary
WorkingMemoryEntryPointAdapter(org.kie.api.runtime.rule.EntryPoint delegate)
           
 
Method Summary
 boolean equals(Object obj)
           
 String getEntryPointId()
          Returns the String Id of this entry point
 long getFactCount()
          Returns the total number of facts currently in this entry point
 FactHandle getFactHandle(Object object)
          Returns the fact handle associated with the given object.
<T extends FactHandle>
Collection<T>
getFactHandles()
          Returns all FactHandles from the current session.
<T extends FactHandle>
Collection<T>
getFactHandles(ObjectFilter filter)
          Returns all FactHandles from the current session for which the facts are accepted by the given filter.
 Object getObject(FactHandle factHandle)
          Returns the object associated with the given FactHandle.
 Collection<Object> getObjects()
           Returns all facts from the current session as a Collection.
 Collection<Object> getObjects(ObjectFilter filter)
          Returns all facts from the current session that are accepted by the given ObjectFilter.
 int hashCode()
           
 FactHandle insert(Object object)
          Inserts a new fact into this entry point
 void retract(FactHandle handle)
          Retracts the fact for which the given FactHandle was assigned.
 void update(FactHandle handle, Object object)
          Updates the fact for which the given FactHandle was assigned with the new fact set as the second parameter in this method.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WorkingMemoryEntryPointAdapter

public WorkingMemoryEntryPointAdapter(org.kie.api.runtime.rule.EntryPoint delegate)
Method Detail

getEntryPointId

public String getEntryPointId()
Description copied from interface: WorkingMemoryEntryPoint
Returns the String Id of this entry point

Specified by:
getEntryPointId in interface WorkingMemoryEntryPoint
Returns:

insert

public FactHandle insert(Object object)
Description copied from interface: WorkingMemoryEntryPoint
Inserts a new fact into this entry point

Specified by:
insert in interface WorkingMemoryEntryPoint
Parameters:
object - the fact to be inserted
Returns:
the fact handle created for the given fact

retract

public void retract(FactHandle handle)
Description copied from interface: WorkingMemoryEntryPoint
Retracts the fact for which the given FactHandle was assigned.

Specified by:
retract in interface WorkingMemoryEntryPoint
Parameters:
handle - the handle whose fact is to be retracted.

update

public void update(FactHandle handle,
                   Object object)
Description copied from interface: WorkingMemoryEntryPoint
Updates the fact for which the given FactHandle was assigned with the new fact set as the second parameter in this method.

Specified by:
update in interface WorkingMemoryEntryPoint
Parameters:
handle - the FactHandle for the fact to be updated.
object - the new value for the fact being updated.

getFactHandle

public FactHandle getFactHandle(Object object)
Description copied from interface: WorkingMemoryEntryPoint
Returns the fact handle associated with the given object. It is important to note that this method behaves in accordance with the configured assert behaviour for this knowledge base (either IDENTITY or EQUALITY).

Specified by:
getFactHandle in interface WorkingMemoryEntryPoint
Parameters:
object - the fact for which the fact handle will be returned.
Returns:
the fact handle for the given object, or null in case no fact handle was found for the given object.
See Also:
KnowledgeBaseConfiguration

getObject

public Object getObject(FactHandle factHandle)
Description copied from interface: WorkingMemoryEntryPoint
Returns the object associated with the given FactHandle.

Specified by:
getObject in interface WorkingMemoryEntryPoint
Returns:

getObjects

public Collection<Object> getObjects()
Description copied from interface: WorkingMemoryEntryPoint

Returns all facts from the current session as a Collection.

This class is not a general-purpose Collection implementation! While this class implements the Collection interface, it intentionally violates Collection general contract, which mandates the use of the equals method when comparing objects.

Instead the approach used when comparing objects with the contains(Object) method is dependent on the WorkingMemory configuration, where it can be configured for Identity or for Equality.

Specified by:
getObjects in interface WorkingMemoryEntryPoint
Returns:

getObjects

public Collection<Object> getObjects(ObjectFilter filter)
Description copied from interface: WorkingMemoryEntryPoint
Returns all facts from the current session that are accepted by the given ObjectFilter.

Specified by:
getObjects in interface WorkingMemoryEntryPoint
Parameters:
filter - the filter to be applied to the returned collection of facts.
Returns:

getFactHandles

public <T extends FactHandle> Collection<T> getFactHandles()
Description copied from interface: WorkingMemoryEntryPoint
Returns all FactHandles from the current session.

Specified by:
getFactHandles in interface WorkingMemoryEntryPoint
Returns:

getFactHandles

public <T extends FactHandle> Collection<T> getFactHandles(ObjectFilter filter)
Description copied from interface: WorkingMemoryEntryPoint
Returns all FactHandles from the current session for which the facts are accepted by the given filter.

Specified by:
getFactHandles in interface WorkingMemoryEntryPoint
Parameters:
filter - the filter to be applied to the returned collection of FactHandles.
Returns:

getFactCount

public long getFactCount()
Description copied from interface: WorkingMemoryEntryPoint
Returns the total number of facts currently in this entry point

Specified by:
getFactCount in interface WorkingMemoryEntryPoint
Returns:

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

Knowledge API Legacy5 Adapter 6.1.0.Final

Copyright © 2001-2014 JBoss by Red Hat. All Rights Reserved.