Пример #1
0
  /**
   * Returns the parameters associated with this object. The returned list is intended for external
   * use in documentation; the parameter objects returned may or may not be those used for obtaining
   * values from a particular execution environment. For this reason they may have names which are
   * symbolic, that is, represent possible parameter names. Since actual parameter names are
   * dynamically determined from other parameter names, it is not possible to return an exhaustive
   * list.
   *
   * @return array of parameters to be used for documentation
   */
  public Parameter[] getParameters() {

    /* Create and return a list of parameters some of which have
     * "example" suffixes.  In some cases the parameters which
     * supply actual values to this factory are constructed as
     * required elsewhere in this class. */
    String tSuffix = TABLE_VARIABLE;
    String stSuffix = TABLE_VARIABLE + SUBSET_VARIABLE;
    String auxAxName = AUX_PREFIX + AUX_VARIABLE;

    /* Per-table input parameters. */
    InputTableParameter inParam = createTableParameter(tSuffix);
    FilterParameter filterParam = createFilterParameter(tSuffix);
    List paramList = new ArrayList();
    paramList.add(inParam);
    paramList.add(inParam.getFormatParameter());
    paramList.add(inParam.getStreamParameter());
    paramList.add(filterParam);

    /* Per-axis parameters. */
    List axParamSetList = new ArrayList();
    for (int idim = 0; idim < mainDimNames_.length; idim++) {
      axParamSetList.add(new AxisParameterSet(mainDimNames_[idim]));
    }
    if (useAux_) {
      axParamSetList.add(new AxisParameterSet(auxAxName));
    }
    AxisParameterSet[] axParamSets =
        (AxisParameterSet[]) axParamSetList.toArray(new AxisParameterSet[0]);
    int allNdim = axParamSets.length;
    Parameter[][] axScalarParams = new Parameter[allNdim][];
    for (int idim = 0; idim < allNdim; idim++) {
      AxisParameterSet axParamSet = axParamSets[idim];
      paramList.add(axParamSet.createCoordParameter(tSuffix));
      axScalarParams[idim] = axParamSet.getScalarParameters();
    }
    int nScalarParam = axScalarParams[0].length; // same for all elements
    for (int ip = 0; ip < nScalarParam; ip++) {
      for (int idim = 0; idim < allNdim; idim++) {
        paramList.add(axScalarParams[idim][ip]);
      }
    }
    for (int idim = 0; idim < errNdim_; idim++) {
      paramList.add(createErrorParameter(mainDimNames_[idim], tSuffix));
    }
    if (useAux_) {
      Parameter shaderParam = createShaderParameters(new String[] {AUX_VARIABLE})[0];
      assert shaderParam.getDefault() != null;
      paramList.add(shaderParam);
    }

    /* Other parameters. */
    if (useLabel_) {
      paramList.add(createLabelParameter(tSuffix));
    }
    paramList.add(createSubsetExpressionParameter(stSuffix));
    paramList.add(createSubsetNameParameter(stSuffix));
    paramList.addAll(Arrays.asList(createStyleFactory(STYLE_PREFIX).getParameters(stSuffix)));
    paramList.add(gridParam_);
    paramList.add(aaParam_);
    paramList.add(seqParam_);
    return (Parameter[]) paramList.toArray(new Parameter[0]);
  }