edu.umass.cs.sase.query
Class NFA

java.lang.Object
  extended by edu.umass.cs.sase.query.NFA

public class NFA
extends java.lang.Object

This class represents an NFA.

Author:
haopeng

Constructor Summary
NFA(java.lang.String nfaFile)
          Constructs an NFA from a file
NFA(java.lang.String selectionStrategy, java.lang.String nfaFile)
          Constructs an NFA from a file, specifies the selection strategy
 
Method Summary
 void addMorePartitionAttribute()
          Adds other partition attributes except for the first to each state
 void compileValueVectorOptimized()
          Compiles the value vector based on the nfa
 boolean[] getHasValueVector()
           
 State getNegationState()
           
 java.lang.String getPartitionAttribute()
           
 java.lang.String getSelectionStrategy()
           
 int getSize()
           
 State[] getStates()
           
 State getStates(int order)
           
 int getTimeWindow()
           
 ValueVectorTemplate[][] getValueVectors()
           
 boolean isHasNegation()
           
 boolean isHasPartitionAttribute()
           
 boolean isNeedValueVector()
           
 void parseConfig(java.lang.String attribute)
          Parses a configuration, now we have selection strategy, time window and partiton attribute
 void parseFastQueryLine(java.lang.String line)
          Parses each line for the fast query format
 void parseFastQueryLineStartWithAND(java.lang.String line)
          Parses the conditions starting with "AND", it might be the partition attribute, or predicates for states
 void parseFastQueryLineStartWithPattern(java.lang.String line)
          Parses the query sequence
 void parseNfaConfig(java.lang.String line)
          Parses the configuration line in the nfa file
 void parseNfaFile(java.lang.String nfaFile)
          Parses the nfa file
 void setHasNegation(boolean hasNegation)
           
 void setHasPartitionAttribute(boolean hasPartitionAttribute)
           
 void setHasValueVector(boolean[] hasValueVector)
           
 void setNeedValueVector(boolean needValueVector)
           
 void setNegationState(State negationState)
           
 void setPartitionAttribute(java.lang.String partitionAttribute)
           
 void setSelectionStrategy(java.lang.String selectionStrategy)
           
 void setSize(int size)
           
 void setStates(State[] states)
           
 void setTimeWindow(int timeWindow)
           
 void setValueVectors(ValueVectorTemplate[][] valueVectors)
           
 void testNegation()
          Tests whether the query contains a negation component
 java.lang.String toString()
          Self description
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NFA

public NFA(java.lang.String nfaFile)
Constructs an NFA from a file

Parameters:
nfaFile - the nfa file

NFA

public NFA(java.lang.String selectionStrategy,
           java.lang.String nfaFile)
Constructs an NFA from a file, specifies the selection strategy

Parameters:
selectionStrategy -
nfaFile -
Method Detail

parseNfaFile

public void parseNfaFile(java.lang.String nfaFile)
Parses the nfa file

Parameters:
nfaFile - the nfa file

parseFastQueryLine

public void parseFastQueryLine(java.lang.String line)
Parses each line for the fast query format

Parameters:
line -

parseFastQueryLineStartWithPattern

public void parseFastQueryLineStartWithPattern(java.lang.String line)
Parses the query sequence

Parameters:
line -

parseFastQueryLineStartWithAND

public void parseFastQueryLineStartWithAND(java.lang.String line)
Parses the conditions starting with "AND", it might be the partition attribute, or predicates for states

Parameters:
line -

addMorePartitionAttribute

public void addMorePartitionAttribute()
Adds other partition attributes except for the first to each state


parseNfaConfig

public void parseNfaConfig(java.lang.String line)
Parses the configuration line in the nfa file

Parameters:
line -

parseConfig

public void parseConfig(java.lang.String attribute)
Parses a configuration, now we have selection strategy, time window and partiton attribute

Parameters:
attribute - a configuration

testNegation

public void testNegation()
Tests whether the query contains a negation component


compileValueVectorOptimized

public void compileValueVectorOptimized()
Compiles the value vector based on the nfa


toString

public java.lang.String toString()
Self description

Overrides:
toString in class java.lang.Object

getStates

public State[] getStates()
Returns:
the states

getStates

public State getStates(int order)

setStates

public void setStates(State[] states)
Parameters:
states - the states to set

getSize

public int getSize()
Returns:
the size

setSize

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

getSelectionStrategy

public java.lang.String getSelectionStrategy()
Returns:
the selectionStrategy

setSelectionStrategy

public void setSelectionStrategy(java.lang.String selectionStrategy)
Parameters:
selectionStrategy - the selectionStrategy to set

getTimeWindow

public int getTimeWindow()
Returns:
the timeWindow

setTimeWindow

public void setTimeWindow(int timeWindow)
Parameters:
timeWindow - the timeWindow to set

isNeedValueVector

public boolean isNeedValueVector()
Returns:
the needValueVector

setNeedValueVector

public void setNeedValueVector(boolean needValueVector)
Parameters:
needValueVector - the needValueVector to set

getPartitionAttribute

public java.lang.String getPartitionAttribute()
Returns:
the partitionAttribute

setPartitionAttribute

public void setPartitionAttribute(java.lang.String partitionAttribute)
Parameters:
partitionAttribute - the partitionAttribute to set

getValueVectors

public ValueVectorTemplate[][] getValueVectors()
Returns:
the valueVectors

setValueVectors

public void setValueVectors(ValueVectorTemplate[][] valueVectors)
Parameters:
valueVectors - the valueVectors to set

getHasValueVector

public boolean[] getHasValueVector()
Returns:
the hasValueVector

setHasValueVector

public void setHasValueVector(boolean[] hasValueVector)
Parameters:
hasValueVector - the hasValueVector to set

isHasPartitionAttribute

public boolean isHasPartitionAttribute()
Returns:
the hasPartitionAttribute

setHasPartitionAttribute

public void setHasPartitionAttribute(boolean hasPartitionAttribute)
Parameters:
hasPartitionAttribute - the hasPartitionAttribute to set

isHasNegation

public boolean isHasNegation()
Returns:
the hasNegation

setHasNegation

public void setHasNegation(boolean hasNegation)
Parameters:
hasNegation - the hasNegation to set

getNegationState

public State getNegationState()
Returns:
the negationState

setNegationState

public void setNegationState(State negationState)
Parameters:
negationState - the negationState to set