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 Externalizable
IOException
ClassNotFoundException
Externalizable.readExternal(java.io.ObjectInput)
public void writeExternal(ObjectOutput out) throws IOException
writeExternal
in interface Externalizable
IOException
Externalizable.writeExternal(java.io.ObjectOutput)
public Behavior.BehaviorType getType()
Behavior
public long getSize()
public void setSize(int size)
size
- the size to setpublic Behavior.Context createContext()
Behavior
createContext
in interface Behavior
public boolean assertFact(Object context, InternalFactHandle handle, PropagationContext pctx, InternalWorkingMemory workingMemory)
Behavior
assertFact
in interface Behavior
context
- 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)
Behavior
retractFact
in interface Behavior
context
- The behavior context objecthandle
- The fact leaving the behavior's scopeworkingMemory
- The working memory session referencepublic void expireFacts(Object context, PropagationContext pctx, InternalWorkingMemory workingMemory)
Behavior
expireFacts
in interface Behavior
public long getExpirationOffset()
getExpirationOffset
in interface Behavior
Copyright © 2001–2017 JBoss by Red Hat. All rights reserved.