コード例 #1
0
 private static List<Integer> getInputChannels(Iterable<RowExpression> expressions) {
   TreeSet<Integer> channels = new TreeSet<>();
   for (RowExpression expression : Expressions.subExpressions(expressions)) {
     if (expression instanceof InputReferenceExpression) {
       channels.add(((InputReferenceExpression) expression).getField());
     }
   }
   return ImmutableList.copyOf(channels);
 }
コード例 #2
0
 private static boolean isConstantExpression(RowExpression expression) {
   List<RowExpression> rowExpressions = Expressions.subExpressions(ImmutableList.of(expression));
   return rowExpressions.size() == 1
       && Iterables.getOnlyElement(rowExpressions) instanceof ConstantExpression
       && ((ConstantExpression) Iterables.getOnlyElement(rowExpressions)).getValue() != null;
 }
コード例 #3
0
 private static boolean isIdentityExpression(RowExpression expression) {
   List<RowExpression> rowExpressions = Expressions.subExpressions(ImmutableList.of(expression));
   return rowExpressions.size() == 1
       && Iterables.getOnlyElement(rowExpressions) instanceof InputReferenceExpression;
 }