net.sf.saffron.opt
Class CallingConvention

java.lang.Object
  |
  +--net.sf.saffron.util.EnumeratedValues.BasicValue
        |
        +--net.sf.saffron.opt.CallingConvention
All Implemented Interfaces:
EnumeratedValues.Value

public class CallingConvention
extends EnumeratedValues.BasicValue

CallingConvention enumerates all calling conventions defined by Saffron itself. This set can be extended by applications by defining new instances of CallingConvention and registering them with a planner, along with the desired conversion rules. Extended ordinals must be greater than CallingConvention.enumeration.getMax().


Field Summary
static CallingConvention ARRAY
           
static int ARRAY_ORDINAL
          The ARRAY calling convention results in a Java expression which evaluates to an array containing the rows returned.
static CallingConvention COLLECTION
           
static int COLLECTION_ORDINAL
          The COLLECTION calling convention results in a Java expression which evaluates to a Collection, typically a ArrayList.
static EnumeratedValues enumeration
           
static CallingConvention ENUMERATION
           
static int ENUMERATION_ORDINAL
           
static CallingConvention EXISTS
           
static int EXISTS_ORDINAL
          The EXISTS calling convention is only allowed for a terminator.
static CallingConvention HASHTABLE
           
static int HASHTABLE_ORDINAL
           
static CallingConvention ITERABLE
           
static int ITERABLE_ORDINAL
          The ITERABLE calling convention means that the expression is converted to an openjava expression (Expression) which evalutes to an object which implements Iterable.
static CallingConvention ITERATOR
           
static int ITERATOR_ORDINAL
          The ITERATOR calling convention means that the expression is converted to an openjava expression (Expression) which evalutes to an Iterator.
static CallingConvention JAVA
           
static int JAVA_ORDINAL
          The JAVA calling convention means that the expression is converted into an Openjava parse tree, which can then be un-parsed, compiled, and executed as java code.
static CallingConvention MAP
           
static int MAP_ORDINAL
           
static CallingConvention NONE
           
static int NONE_ORDINAL
          The NONE calling convention means that expression does not support any calling convention -- in other words, it is not implementable, and has to be transformed to something else in order to be implemented.
static CallingConvention RESULT_SET
           
static int RESULT_SET_ORDINAL
          The RESULT_SET calling convention means that the expression is a JDBC result set.
static CallingConvention[] values
           
static CallingConvention VECTOR
           
static int VECTOR_ORDINAL
           
 
Fields inherited from class net.sf.saffron.util.EnumeratedValues.BasicValue
description_, name_, ordinal_
 
Constructor Summary
CallingConvention(String name, int ordinal)
           
 
Methods inherited from class net.sf.saffron.util.EnumeratedValues.BasicValue
equals, getDescription, getName, getOrdinal, toString, unexpected
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NONE_ORDINAL

public static final int NONE_ORDINAL
The NONE calling convention means that expression does not support any calling convention -- in other words, it is not implementable, and has to be transformed to something else in order to be implemented.

See Also:
Constant Field Values

NONE

public static final CallingConvention NONE

JAVA_ORDINAL

public static final int JAVA_ORDINAL
The JAVA calling convention means that the expression is converted into an Openjava parse tree, which can then be un-parsed, compiled, and executed as java code.

The SaffronRel.implement(net.sf.saffron.opt.RelImplementor, int) method generates a piece of code which will call the piece of code corresponding to the parent once for each row:

See Also:
Constant Field Values

JAVA

public static final CallingConvention JAVA

ITERATOR_ORDINAL

public static final int ITERATOR_ORDINAL
The ITERATOR calling convention means that the expression is converted to an openjava expression (Expression) which evalutes to an Iterator. See ConverterRel.

See Also:
Constant Field Values

ITERATOR

public static final CallingConvention ITERATOR

ARRAY_ORDINAL

public static final int ARRAY_ORDINAL
The ARRAY calling convention results in a Java expression which evaluates to an array containing the rows returned. Compare with JAVA_ORDINAL, where a loop does something for each row returned).

See Also:
Constant Field Values

ARRAY

public static final CallingConvention ARRAY

COLLECTION_ORDINAL

public static final int COLLECTION_ORDINAL
The COLLECTION calling convention results in a Java expression which evaluates to a Collection, typically a ArrayList.

See Also:
Constant Field Values

COLLECTION

public static final CallingConvention COLLECTION

VECTOR_ORDINAL

public static final int VECTOR_ORDINAL
See Also:
Constant Field Values

VECTOR

public static final CallingConvention VECTOR

ENUMERATION_ORDINAL

public static final int ENUMERATION_ORDINAL
See Also:
Constant Field Values

ENUMERATION

public static final CallingConvention ENUMERATION

MAP_ORDINAL

public static final int MAP_ORDINAL
See Also:
Constant Field Values

MAP

public static final CallingConvention MAP

HASHTABLE_ORDINAL

public static final int HASHTABLE_ORDINAL
See Also:
Constant Field Values

HASHTABLE

public static final CallingConvention HASHTABLE

ITERABLE_ORDINAL

public static final int ITERABLE_ORDINAL
The ITERABLE calling convention means that the expression is converted to an openjava expression (Expression) which evalutes to an object which implements Iterable.

See Also:
Constant Field Values

ITERABLE

public static final CallingConvention ITERABLE

EXISTS_ORDINAL

public static final int EXISTS_ORDINAL
The EXISTS calling convention is only allowed for a terminator.

See Also:
Constant Field Values

EXISTS

public static final CallingConvention EXISTS

RESULT_SET_ORDINAL

public static final int RESULT_SET_ORDINAL
The RESULT_SET calling convention means that the expression is a JDBC result set. When a result set is converted to another convention such as array or iterator, the default object type is Row.

See Also:
Constant Field Values

RESULT_SET

public static final CallingConvention RESULT_SET

values

public static final CallingConvention[] values

enumeration

public static final EnumeratedValues enumeration
Constructor Detail

CallingConvention

public CallingConvention(String name,
                         int ordinal)

SourceForge.net_Logo