Package com.odiago.flumebase.lang

Examples of com.odiago.flumebase.lang.UniversalType


*/
public class sum extends AggregateFunc<Number> {
  private UniversalType mArgType;

  public sum() {
    mArgType = new UniversalType("'a");
    mArgType.addConstraint(Type.getNullable(Type.TypeName.TYPECLASS_NUMERIC));
  }
View Full Code Here


      Type abstractType = abstractArgTypes.get(i);
      Type actualType = mExprTypes.get(i);
      UniversalConstraintExtractor constraintExtractor = new UniversalConstraintExtractor();
      if (constraintExtractor.extractConstraint(abstractType, actualType)) {
        // Found a UniversalType. Make sure it's mapped to a list of actual constraints.
        UniversalType univType = constraintExtractor.getUniversalType();
        List<Type> actualConstraints = unifications.get(univType);
        if (null == actualConstraints) {
          actualConstraints = new ArrayList<Type>();
          unifications.put(univType, actualConstraints);
        }

        // Add the actual constraint of the expression being applied as this argument.
        actualConstraints.add(constraintExtractor.getConstraintType());
      }
    }

    // Perform unifications on all the UniversalType expressions.
    Map<Type, Type> unificationOut = new HashMap<Type, Type>();
    for (Map.Entry<UniversalType, List<Type>> unification : unifications.entrySet()) {
      UniversalType univType = unification.getKey();
      List<Type> actualConstraints = unification.getValue();
      Type out = univType.getRuntimeType(actualConstraints);
      unificationOut.put(univType, out);
    }
   
    // Finally, generate a list of concrete argument types for coercion purposes.
    for (int i = 0; i < abstractArgTypes.size(); i++ ) {
View Full Code Here

   */
  private static class max2 extends ScalarFunc {
    private UniversalType mArgType;

    public max2() {
      mArgType = new UniversalType("'a");
    }
View Full Code Here

TOP

Related Classes of com.odiago.flumebase.lang.UniversalType

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.