edu.umass.cs.sase.engine
Class Run

java.lang.Object
  extended by edu.umass.cs.sase.engine.Run
All Implemented Interfaces:
java.lang.Cloneable

public class Run
extends java.lang.Object
implements java.lang.Cloneable

This class represents a run.

Author:
haopeng

Constructor Summary
Run()
          Default constructor.
Run(NFA nfa)
          Constructor, initialized by the nfa for a query
 
Method Summary
 void addEvent(Event e)
          Adds an event to the run, and makes necessary updates of the run status and value vectors.
 boolean checkMatch()
          Checks whether the match is ready to make a match
 java.lang.Object clone()
          Clones the run itself
 int getAfterNegationTimestamp()
           
 int getBeforeNegationTimestamp()
           
 int getCount()
           
 int getCurrentState()
           
 java.util.ArrayList<java.lang.Integer> getEventIds()
           
 int getLastNEventId(int n)
          Returns the last n event id last 1 means the last event last 2 means the last second event
 long getLifeTimeBegin()
           
 int getNeededValueVector(int stateNumber, java.lang.String attribute, java.lang.String operation)
          returns the needed value vector
 NFA getNfa()
           
 int getPartitonId()
           
 int getPreviousEventId()
           
 int getSize()
           
 int getStartTimeStamp()
           
 int[] getState()
           
 ValueVectorElement[][] getValueVector()
           
 void initializeValueVector(Event e)
          Initializes the value vectors of the computation state
 boolean isAlive()
           
 boolean isComplete()
           
 boolean isFull()
           
 boolean isKleeneClosureInitialized()
           
 void proceed()
          Proceeds a kleene closure state
 void setAfterNegationTimestamp(int afterNegationTimestamp)
           
 void setAlive(boolean alive)
           
 void setBeforeNegationTimestamp(int beforeNegationTimestamp)
           
 void setComplete(boolean isComplete)
           
 void setCount(int count)
           
 void setCurrentState(int currentState)
           
 void setEventIds(java.util.ArrayList<java.lang.Integer> eventIds)
           
 void setFull(boolean isFull)
           
 void setKleeneClosureInitialized(boolean kleeneClosureInitialized)
           
 void setLifeTimeBegin(long lifeTimeBegin)
           
 void setNfa(NFA nfa)
           
 void setPartitonId(int partitonId)
           
 void setSize(int size)
           
 void setStartTimeStamp(int startTimeStamp)
           
 void setState(int[] state)
           
 void setValueVector(ValueVectorElement[][] valueVector)
           
 void updateValueVector(Event e)
          Updates the value vectors for the computation state
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Run

public Run()
Default constructor.


Run

public Run(NFA nfa)
Constructor, initialized by the nfa for a query

Parameters:
nfa - the nfa for a query
Method Detail

checkMatch

public boolean checkMatch()
Checks whether the match is ready to make a match

Returns:
the check result, boolean format

addEvent

public void addEvent(Event e)
Adds an event to the run, and makes necessary updates of the run status and value vectors.

Parameters:
e - the event to be added

getPreviousEventId

public int getPreviousEventId()
Returns:
the id of last selected event

getLastNEventId

public int getLastNEventId(int n)
Returns the last n event id last 1 means the last event last 2 means the last second event

Parameters:
n - the relative position
Returns:
the event id

proceed

public void proceed()
Proceeds a kleene closure state


clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Clones the run itself

Overrides:
clone in class java.lang.Object
Throws:
java.lang.CloneNotSupportedException

initializeValueVector

public void initializeValueVector(Event e)
Initializes the value vectors of the computation state

Parameters:
e - the first selected event for a state

updateValueVector

public void updateValueVector(Event e)
Updates the value vectors for the computation state

Parameters:
e - the latest selected event

getNeededValueVector

public int getNeededValueVector(int stateNumber,
                                java.lang.String attribute,
                                java.lang.String operation)
returns the needed value vector

Parameters:
stateNumber - the state which the needed value vector is at
attribute - the attribute of the value vector
operation - the operation name of the value vector
Returns:
the current value of the value vector

isAlive

public boolean isAlive()
Returns:
the alive

setAlive

public void setAlive(boolean alive)
Parameters:
alive - the alive to set

getCurrentState

public int getCurrentState()
Returns:
the currentState

setCurrentState

public void setCurrentState(int currentState)
Parameters:
currentState - the currentState to set

getState

public int[] getState()
Returns:
the state

setState

public void setState(int[] state)
Parameters:
state - the state to set

getNfa

public NFA getNfa()
Returns:
the nfa

setNfa

public void setNfa(NFA nfa)
Parameters:
nfa - the nfa to set

getLifeTimeBegin

public long getLifeTimeBegin()
Returns:
the lifeTimeBegin

setLifeTimeBegin

public void setLifeTimeBegin(long lifeTimeBegin)
Parameters:
lifeTimeBegin - the lifeTimeBegin to set

isComplete

public boolean isComplete()
Returns:
the isComplete

setComplete

public void setComplete(boolean isComplete)
Parameters:
isComplete - the isComplete to set

isFull

public boolean isFull()
Returns:
the isFull

setFull

public void setFull(boolean isFull)
Parameters:
isFull - the isFull to set

getStartTimeStamp

public int getStartTimeStamp()
Returns:
the startTimeStamp

setStartTimeStamp

public void setStartTimeStamp(int startTimeStamp)
Parameters:
startTimeStamp - the startTimeStamp to set

getEventIds

public java.util.ArrayList<java.lang.Integer> getEventIds()
Returns:
the eventIds

setEventIds

public void setEventIds(java.util.ArrayList<java.lang.Integer> eventIds)
Parameters:
eventIds - the eventIds to set

getSize

public int getSize()
Returns:
the size

setSize

public void setSize(int size)
Parameters:
size - the size to set

getCount

public int getCount()
Returns:
the count

setCount

public void setCount(int count)
Parameters:
count - the count to set

getPartitonId

public int getPartitonId()
Returns:
the partitonId

setPartitonId

public void setPartitonId(int partitonId)
Parameters:
partitonId - the partitonId to set

isKleeneClosureInitialized

public boolean isKleeneClosureInitialized()
Returns:
the kleeneClosureInitialized

setKleeneClosureInitialized

public void setKleeneClosureInitialized(boolean kleeneClosureInitialized)
Parameters:
kleeneClosureInitialized - the kleeneClosureInitialized to set

getValueVector

public ValueVectorElement[][] getValueVector()
Returns:
the valueVector

setValueVector

public void setValueVector(ValueVectorElement[][] valueVector)
Parameters:
valueVector - the valueVector to set

getBeforeNegationTimestamp

public int getBeforeNegationTimestamp()
Returns:
the beforeNegationTimestamp

setBeforeNegationTimestamp

public void setBeforeNegationTimestamp(int beforeNegationTimestamp)
Parameters:
beforeNegationTimestamp - the beforeNegationTimestamp to set

getAfterNegationTimestamp

public int getAfterNegationTimestamp()
Returns:
the afterNegationTimestamp

setAfterNegationTimestamp

public void setAfterNegationTimestamp(int afterNegationTimestamp)
Parameters:
afterNegationTimestamp - the afterNegationTimestamp to set