本文整理汇总了Java中org.apache.calcite.linq4j.function.Parameter类的典型用法代码示例。如果您正苦于以下问题:Java Parameter类的具体用法?Java Parameter怎么用?Java Parameter使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Parameter类属于org.apache.calcite.linq4j.function包,在下文中一共展示了Parameter类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: randSeed
import org.apache.calcite.linq4j.function.Parameter; //导入依赖的package包/类
/** Implements the {@code RAND(seed)} SQL function. */
public double randSeed(@Parameter(name = "seed") int seed) {
if (random == null) {
random = new Random(seed ^ (seed << 16));
}
return random.nextDouble();
}
示例2: randInteger
import org.apache.calcite.linq4j.function.Parameter; //导入依赖的package包/类
/** Implements the {@code RAND_INTEGER(bound)} SQL function. */
public int randInteger(@Parameter(name = "bound") int bound) {
if (random == null) {
random = new Random();
}
return random.nextInt(bound);
}
示例3: randIntegerSeed
import org.apache.calcite.linq4j.function.Parameter; //导入依赖的package包/类
/** Implements the {@code RAND_INTEGER(seed, bound)} SQL function. */
public int randIntegerSeed(@Parameter(name = "seed") int seed,
@Parameter(name = "bound") int bound) {
if (random == null) {
random = new Random(seed);
}
return random.nextInt(bound);
}
示例4: getParameterName
import org.apache.calcite.linq4j.function.Parameter; //导入依赖的package包/类
/** Derives the name of the {@code i}th parameter of a method. */
public static String getParameterName(Method method, int i) {
for (Annotation annotation : method.getParameterAnnotations()[i]) {
if (annotation.annotationType() == Parameter.class) {
return ((Parameter) annotation).name();
}
}
return Compatible.INSTANCE.getParameterName(method, i);
}
示例5: isParameterOptional
import org.apache.calcite.linq4j.function.Parameter; //导入依赖的package包/类
/** Derives whether the {@code i}th parameter of a method is optional. */
public static boolean isParameterOptional(Method method, int i) {
for (Annotation annotation : method.getParameterAnnotations()[i]) {
if (annotation.annotationType() == Parameter.class) {
return ((Parameter) annotation).optional();
}
}
return false;
}
示例6: eval
import org.apache.calcite.linq4j.function.Parameter; //导入依赖的package包/类
public String eval(@Parameter(name = "A", optional = false) Integer a,
@Parameter(name = "B", optional = true) Integer b,
@Parameter(name = "C", optional = false) Integer c,
@Parameter(name = "D", optional = true) Integer d,
@Parameter(name = "E", optional = true) Integer e) {
return "{a: " + a + ", b: " + b + ", c: " + c + ", d: " + d + ", e: "
+ e + "}";
}
示例7: generate2
import org.apache.calcite.linq4j.function.Parameter; //导入依赖的package包/类
public static ScannableTable generate2(
@Parameter(name = "WIDTH") int width,
@Parameter(name = "HEIGHT") int height,
@Parameter(name = "SEED", optional = true) Integer seed) {
return new MazeTable(
String.format(Locale.ROOT, "generate2(w=%d, h=%d, s=%d)", width,
height, seed));
}
示例8: eval
import org.apache.calcite.linq4j.function.Parameter; //导入依赖的package包/类
public boolean eval(@Parameter(name = "col") Object col, @Parameter(name = "filterTable") String filterTable) {
return true;
}
示例9: eval
import org.apache.calcite.linq4j.function.Parameter; //导入依赖的package包/类
public String eval(@Parameter(name = "str1") String col1, @Parameter(name = "str2") String col2) {
return col1 + col2;
}
示例10: foo
import org.apache.calcite.linq4j.function.Parameter; //导入依赖的package包/类
/** Dummy method for {@link #testParameterName()} to inspect. */
public static void foo(int i, @Parameter(name = "j") int j) {
}
示例11: generate3
import org.apache.calcite.linq4j.function.Parameter; //导入依赖的package包/类
public static ScannableTable generate3(
@Parameter(name = "FOO") String foo) {
return new MazeTable(
String.format(Locale.ROOT, "generate3(foo=%s)", foo));
}