OmniSciDB  c07336695a
com.mapd.parser.server.ExtensionFunction Class Reference
+ Collaboration diagram for com.mapd.parser.server.ExtensionFunction:

Classes

enum  ExtArgumentType
 

Public Member Functions

List< ExtArgumentTypegetArgs ()
 
ExtArgumentType getRet ()
 
String toJson (final String name)
 

Package Functions

 ExtensionFunction (final List< ExtArgumentType > args, final ExtArgumentType ret)
 

Static Private Member Functions

static String typeName (final ExtArgumentType type)
 
static String dq (final String str)
 

Private Attributes

final List< ExtArgumentTypeargs
 
final ExtArgumentType ret
 

Detailed Description

Author
alex

Definition at line 25 of file ExtensionFunction.java.

Constructor & Destructor Documentation

◆ ExtensionFunction()

com.mapd.parser.server.ExtensionFunction.ExtensionFunction ( final List< ExtArgumentType args,
final ExtArgumentType  ret 
)
inlinepackage

Member Function Documentation

◆ dq()

static String com.mapd.parser.server.ExtensionFunction.dq ( final String  str)
inlinestaticprivate

Definition at line 107 of file ExtensionFunction.java.

Referenced by com.mapd.parser.server.ExtensionFunction.toJson().

107  {
108  return "\"" + str + "\"";
109  }
+ Here is the caller graph for this function:

◆ getArgs()

List<ExtArgumentType> com.mapd.parser.server.ExtensionFunction.getArgs ( )
inline

Definition at line 49 of file ExtensionFunction.java.

References com.mapd.parser.server.ExtensionFunction.args.

Referenced by com.mapd.calcite.parser.MapDSqlOperatorTable.ExtFunction.toSqlSignature().

49  {
50  return this.args;
51  }
+ Here is the caller graph for this function:

◆ getRet()

ExtArgumentType com.mapd.parser.server.ExtensionFunction.getRet ( )
inline

Definition at line 53 of file ExtensionFunction.java.

References com.mapd.parser.server.ExtensionFunction.ret.

Referenced by com.mapd.calcite.parser.MapDSqlOperatorTable.ExtFunction.ExtFunction().

53  {
54  return this.ret;
55  }
+ Here is the caller graph for this function:

◆ toJson()

String com.mapd.parser.server.ExtensionFunction.toJson ( final String  name)
inline

Definition at line 57 of file ExtensionFunction.java.

References com.mapd.parser.server.ExtensionFunction.args, com.mapd.parser.server.ExtensionFunction.dq(), com.mapd.parser.server.ExtensionFunctionSignatureParser.join(), com.mapd.parser.server.ExtensionFunction.ret, and com.mapd.parser.server.ExtensionFunction.typeName().

57  {
58  StringBuilder json_cons = new StringBuilder();
59  json_cons.append("{");
60  json_cons.append("\"name\":").append(dq(name)).append(",");
61  json_cons.append("\"ret\":").append(dq(typeName(ret))).append(",");
62  json_cons.append("\"args\":");
63  json_cons.append("[");
64  List<String> param_list = new ArrayList<String>();
65  for (final ExtArgumentType arg : args) {
66  param_list.add(dq(typeName(arg)));
67  }
68  json_cons.append(ExtensionFunctionSignatureParser.join(param_list, ","));
69  json_cons.append("]");
70  json_cons.append("}");
71  return json_cons.toString();
72  }
static String typeName(final ExtArgumentType type)
static String dq(final String str)
+ Here is the call graph for this function:

◆ typeName()

static String com.mapd.parser.server.ExtensionFunction.typeName ( final ExtArgumentType  type)
inlinestaticprivate

Definition at line 74 of file ExtensionFunction.java.

References Bool, Double, Float, Int16, Int32, Int64, Int8, PDouble, PFloat, PInt16, PInt32, PInt64, and PInt8.

Referenced by com.mapd.parser.server.ExtensionFunction.toJson().

74  {
75  switch (type) {
76  case Bool:
77  return "i1";
78  case Int8:
79  return "i8";
80  case Int16:
81  return "i16";
82  case Int32:
83  return "i32";
84  case Int64:
85  return "i64";
86  case Float:
87  return "float";
88  case Double:
89  return "double";
90  case PInt8:
91  return "i8*";
92  case PInt16:
93  return "i16*";
94  case PInt32:
95  return "i32*";
96  case PInt64:
97  return "i64*";
98  case PFloat:
99  return "float*";
100  case PDouble:
101  return "double*";
102  }
103  assert false;
104  return null;
105  }
+ Here is the caller graph for this function:

Member Data Documentation

◆ args

◆ ret


The documentation for this class was generated from the following file: