public class SlidingLengthWindow extends Object implements Externalizable, Behavior
| Modifier and Type | Class and Description |
|---|---|
static class |
SlidingLengthWindow.SlidingLengthWindowContext
A Context object for length windows
|
Behavior.BehaviorType, Behavior.Context| Modifier and Type | Field and Description |
|---|---|
protected int |
size |
| Constructor and Description |
|---|
SlidingLengthWindow() |
SlidingLengthWindow(int size) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
assertFact(Object context,
InternalFactHandle handle,
PropagationContext pctx,
InternalWorkingMemory workingMemory)
Makes the behavior aware of the new fact entering behavior's scope
|
Behavior.Context |
createContext()
Creates the context object associated with this behavior.
|
void |
expireFacts(Object context,
PropagationContext pctx,
InternalWorkingMemory workingMemory)
A callback method that allows behaviors to expire facts
|
long |
getExpirationOffset()
Length windows don't change expiration offset, so
always return -1
|
long |
getSize() |
Behavior.BehaviorType |
getType()
Returns the type of the behavior
|
void |
readExternal(ObjectInput in) |
void |
retractFact(Object context,
InternalFactHandle handle,
PropagationContext pctx,
InternalWorkingMemory workingMemory)
Removes a right tuple from the behavior's scope
|
void |
setSize(int size) |
String |
toString() |
void |
writeExternal(ObjectOutput out) |
public SlidingLengthWindow()
public SlidingLengthWindow(int size)
size - public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
readExternal in interface ExternalizableIOExceptionClassNotFoundExceptionExternalizable.readExternal(java.io.ObjectInput)public void writeExternal(ObjectOutput out) throws IOException
writeExternal in interface ExternalizableIOExceptionExternalizable.writeExternal(java.io.ObjectOutput)public Behavior.BehaviorType getType()
Behaviorpublic long getSize()
public void setSize(int size)
size - the size to setpublic Behavior.Context createContext()
BehaviorcreateContext in interface Behaviorpublic boolean assertFact(Object context, InternalFactHandle handle, PropagationContext pctx, InternalWorkingMemory workingMemory)
BehaviorassertFact in interface Behaviorcontext - The behavior context objecthandle - The new fact entering behavior's scopeworkingMemory - The working memory session referencepublic void retractFact(Object context, InternalFactHandle handle, PropagationContext pctx, InternalWorkingMemory workingMemory)
BehaviorretractFact in interface Behaviorcontext - The behavior context objecthandle - The fact leaving the behavior's scopeworkingMemory - The working memory session referencepublic void expireFacts(Object context, PropagationContext pctx, InternalWorkingMemory workingMemory)
BehaviorexpireFacts in interface Behaviorpublic long getExpirationOffset()
getExpirationOffset in interface BehaviorCopyright © 2001–2016 JBoss by Red Hat. All rights reserved.