Пример #1
0
  @Override
  public Validation validate() {
    validation.reset();

    if (nameColumn == null) validation.addWarning("No Name Column selected");

    if (raColumn == null) validation.addWarning("No Ra Column selected");

    if (raColumn != null && !Number.class.isAssignableFrom(raColumn.getContentClass()))
      validation.addError("Ra Column doesn't contain numbers");

    if (decColumn == null) validation.addWarning("No Dec Column selected");

    if (decColumn != null && !Number.class.isAssignableFrom(decColumn.getContentClass()))
      validation.addError("Dec Column doesn't contain numbers");

    return validation;
  }
Пример #2
0
  @Override
  public ExtendedTarget build(IFilter filter, int row) throws Exception {
    Target t = new Target();

    if (nameColumn != null) {
      String name = filter.getColumnData(0, nameColumn.getNumber())[row].toString();
      t.setName(name);
    }

    if (raColumn != null) {
      Double ra = ((Number) filter.getData(0, raColumn.getNumber())[row]).doubleValue();
      t.setRa(ra);
    }

    if (decColumn != null) {
      Double dec = ((Number) filter.getData(0, decColumn.getNumber())[row]).doubleValue();
      t.setDec(dec);
    }

    return new ExtendedTarget(t, publisher);
  }