net.esper.eql.join.plan
Class QueryPlanIndex

java.lang.Object
  extended by net.esper.eql.join.plan.QueryPlanIndex

public class QueryPlanIndex
extends Object

Specifies an index to build as part of an overall query plan.


Constructor Summary
QueryPlanIndex(String[][] indexProps, Class[][] optCoercionTypes)
          Ctor.
 
Method Summary
 int addIndex(String[] indexProperties, Class[] coercionTypes)
          Add an index specification element.
 Class[] getCoercionTypes(String[] indexProperties)
          Returns a list of coercion types for a given index.
 Class[][] getCoercionTypesPerIndex()
          Returns property names of all indexes.
protected  int getIndexNum(String[] indexFields)
          Find a matching index for the property names supplied.
 String[][] getIndexProps()
          Returns property names of all indexes.
static String print(QueryPlanIndex[] indexSpecs)
          Print index specifications in readable format.
 void setCoercionTypes(String[] indexProperties, Class[] coercionTypes)
          Sets the coercion types for a given index.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

QueryPlanIndex

public QueryPlanIndex(String[][] indexProps,
                      Class[][] optCoercionTypes)
Ctor.

Parameters:
indexProps - - array of property names with the first dimension suplying the number of distinct indexes. The second dimension can be empty and indicates a full table scan.
optCoercionTypes - - array of coercion types for each index, or null entry for no coercion required
Method Detail

getIndexProps

public String[][] getIndexProps()
Returns property names of all indexes.

Returns:
property names array

getCoercionTypesPerIndex

public Class[][] getCoercionTypesPerIndex()
Returns property names of all indexes.

Returns:
property names array

getIndexNum

protected int getIndexNum(String[] indexFields)
Find a matching index for the property names supplied.

Parameters:
indexFields - - property names to search for
Returns:
-1 if not found, or offset within indexes if found

addIndex

public int addIndex(String[] indexProperties,
                    Class[] coercionTypes)
Add an index specification element.

Parameters:
indexProperties - - list of property names to index
coercionTypes - - list of coercion types if required, or null if no coercion required
Returns:
number indicating position of index that was added

getCoercionTypes

public Class[] getCoercionTypes(String[] indexProperties)
Returns a list of coercion types for a given index.

Parameters:
indexProperties - is the index field names
Returns:
coercion types, or null if no coercion is required

setCoercionTypes

public void setCoercionTypes(String[] indexProperties,
                             Class[] coercionTypes)
Sets the coercion types for a given index.

Parameters:
indexProperties - is the index property names
coercionTypes - is the coercion types

toString

public String toString()
Overrides:
toString in class Object

print

public static String print(QueryPlanIndex[] indexSpecs)
Print index specifications in readable format.

Parameters:
indexSpecs - - define indexes
Returns:
readable format of index info