org.drools.common
Class EventFactHandle

java.lang.Object
  extended by org.drools.common.DefaultFactHandle
      extended by org.drools.common.EventFactHandle
All Implemented Interfaces:
Serializable, Cloneable, Comparable<EventFactHandle>, InternalFactHandle, org.drools.runtime.rule.FactHandle

public class EventFactHandle
extends DefaultFactHandle
implements Comparable<EventFactHandle>

See Also:
Serialized Form

Constructor Summary
EventFactHandle()
           
EventFactHandle(int id, Object object, long recency, long timestamp, long duration, org.drools.runtime.rule.WorkingMemoryEntryPoint wmEntryPoint)
          Creates a new event fact handle.
EventFactHandle(int id, Object object, long recency, long timestamp, long duration, org.drools.runtime.rule.WorkingMemoryEntryPoint wmEntryPoint, boolean isTraitOrTraitable)
          Creates a new event fact handle.
 
Method Summary
 void addFirstWindowTupleList(WindowTupleList window)
           
 void addLastWindowTupleList(WindowTupleList window)
           
 EventFactHandle clone()
           
 int compareTo(EventFactHandle e)
           
 void decPendingActions()
           
 void decreaseActivationsCount()
           
 long getActivationsCount()
           
 long getDuration()
          Returns the duration of this event.
 long getEndTimestamp()
          Returns the end timestamp for this event.
 long getStartTimestamp()
          Returns the timestamp of the occurrence of this event.
 boolean hasPendingActions()
           
 void incPendingActions()
           
 void increaseActivationsCount()
           
 boolean isEvent()
          Always returns true, since the EventFactHandle is only used for Events, and not for regular Facts
 boolean isExpired()
           
 void removeWindowTupleList(WindowTupleList window)
           
 void setActivationsCount(long activationsCount)
           
 void setExpired(boolean expired)
           
 String toExternalForm()
          format_version:id:identity:hashcode:recency
 String toString()
           
 
Methods inherited from class org.drools.common.DefaultFactHandle
addFirstLeftTuple, addFirstRightTuple, addLastLeftTuple, addLastRightTuple, addLeftTupleInPosition, addRightTupleInPosition, clearLeftTuples, clearRightTuples, determineIdentityHashCode, disconnect, equals, getEntryPoint, getEqualityKey, getExternalForm, getFirstLeftTuple, getFirstRightTuple, getId, getIdentityHashCode, getLastLeftTuple, getLastRightTuple, getObject, getObjectHashCode, getRecency, hashCode, invalidate, isDisconnected, isTraitable, isTraiting, isTraitOrTraitable, isValid, removeLeftTuple, removeRightTuple, setEntryPoint, setEqualityKey, setExternalForm, setFirstLeftTuple, setFirstRightTuple, setLastLeftTuple, setLastRightTuple, setObject, setObjectHashCode, setRecency, toTupleTree
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

EventFactHandle

public EventFactHandle()

EventFactHandle

public EventFactHandle(int id,
                       Object object,
                       long recency,
                       long timestamp,
                       long duration,
                       org.drools.runtime.rule.WorkingMemoryEntryPoint wmEntryPoint)
Creates a new event fact handle.

Parameters:
id - this event fact handle ID
object - the event object encapsulated in this event fact handle
recency - the recency of this event fact handle
timestamp - the timestamp of the occurrence of this event
duration - the duration of this event. May be 0 (zero) in case this is a primitive event.

EventFactHandle

public EventFactHandle(int id,
                       Object object,
                       long recency,
                       long timestamp,
                       long duration,
                       org.drools.runtime.rule.WorkingMemoryEntryPoint wmEntryPoint,
                       boolean isTraitOrTraitable)
Creates a new event fact handle.

Parameters:
id - this event fact handle ID
object - the event object encapsulated in this event fact handle
recency - the recency of this event fact handle
timestamp - the timestamp of the occurrence of this event
duration - the duration of this event. May be 0 (zero) in case this is a primitive event.
Method Detail

toExternalForm

public String toExternalForm()
Description copied from class: DefaultFactHandle
format_version:id:identity:hashcode:recency

Specified by:
toExternalForm in interface InternalFactHandle
Specified by:
toExternalForm in interface org.drools.runtime.rule.FactHandle
Overrides:
toExternalForm in class DefaultFactHandle
See Also:
1: is used for EventFactHandle

toString

public String toString()
Overrides:
toString in class DefaultFactHandle
See Also:
Object

isEvent

public boolean isEvent()
Always returns true, since the EventFactHandle is only used for Events, and not for regular Facts

Specified by:
isEvent in interface InternalFactHandle
Overrides:
isEvent in class DefaultFactHandle
Returns:

getStartTimestamp

public long getStartTimestamp()
Returns the timestamp of the occurrence of this event.

Returns:

getDuration

public long getDuration()
Returns the duration of this event. In case this is a primitive event, returns 0 (zero).

Returns:

getEndTimestamp

public long getEndTimestamp()
Returns the end timestamp for this event. This is the same as: startTimestamp + duration

Returns:

isExpired

public boolean isExpired()

setExpired

public void setExpired(boolean expired)

getActivationsCount

public long getActivationsCount()

setActivationsCount

public void setActivationsCount(long activationsCount)

increaseActivationsCount

public void increaseActivationsCount()

decreaseActivationsCount

public void decreaseActivationsCount()

addFirstWindowTupleList

public void addFirstWindowTupleList(WindowTupleList window)

addLastWindowTupleList

public void addLastWindowTupleList(WindowTupleList window)

removeWindowTupleList

public void removeWindowTupleList(WindowTupleList window)

clone

public EventFactHandle clone()
Specified by:
clone in interface InternalFactHandle
Overrides:
clone in class DefaultFactHandle

compareTo

public int compareTo(EventFactHandle e)
Specified by:
compareTo in interface Comparable<EventFactHandle>

hasPendingActions

public boolean hasPendingActions()

incPendingActions

public void incPendingActions()

decPendingActions

public void decPendingActions()


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