Пример #1
0
  public void setViewParameters(
      ViewFactoryContext viewFactoryContext, List<ExprNode> expressionParameters)
      throws ViewParameterException {
    List<Object> viewParameters =
        ViewFactorySupport.validateAndEvaluate(
            "Time batch view", viewFactoryContext.getStatementContext(), expressionParameters);
    String errorMessage =
        "Time batch view requires a single numeric or time period parameter, and an optional long-typed reference point in msec, and an optional list of control keywords as a string parameter (please see the documentation)";
    if ((viewParameters.size() < 1) || (viewParameters.size() > 3)) {
      throw new ViewParameterException(errorMessage);
    }

    processExpiry(
        viewParameters.get(0), errorMessage, "Time batch view requires a size of at least 1 msec");

    if ((viewParameters.size() == 2) && (viewParameters.get(1) instanceof String)) {
      processKeywords(viewParameters.get(1), errorMessage);
    } else {
      if (viewParameters.size() >= 2) {
        Object paramRef = viewParameters.get(1);
        if ((!(paramRef instanceof Number))
            || (JavaClassHelper.isFloatingPointNumber((Number) paramRef))) {
          throw new ViewParameterException(
              "Time batch view requires a Long-typed reference point in msec as a second parameter");
        }
        optionalReferencePoint = ((Number) paramRef).longValue();
      }

      if (viewParameters.size() == 3) {
        processKeywords(viewParameters.get(2), errorMessage);
      }
    }
  }
Пример #2
0
 public EventType getEventType() {
   return ExactRegressionLinestView.getEventType(viewFactoryContext.getEventAdapterService());
 }
Пример #3
0
 public void setViewParameters(
     ViewFactoryContext viewFactoryContext, List<ExprNode> expressionParameters)
     throws ViewParameterException {
   this.viewParameters = expressionParameters;
   this.streamNumber = viewFactoryContext.getStreamNum();
 }