Package org.aavso.tools.vstar.data

Examples of org.aavso.tools.vstar.data.InvalidObservation


   */
  public Object getValueAt(int rowIndex, int columnIndex) {
    assert columnIndex < COLUMNS;

    Object value = null;
    InvalidObservation invalidOb = invalidObservations.get(rowIndex);
    switch (columnIndex) {
    case 0:
      // TODO: we really want to return an integer so that column
      // sorting works properly for numbers!
      value = String.format("%d", invalidOb.getRecordNumber());
      break;
    case 1:
      value = invalidOb.getInputLine();
      break;
    case 2:
      value = invalidOb.getError();
      break;
    }
    return value;
  }
View Full Code Here


        // observation for it.
        try {
          validOb = getNextObservation();
        } catch (SQLException e) {
          int uniqueId = source.getInt("unique_id");
          InvalidObservation invalidOb = new InvalidObservation(
              "Row with unique ID " + uniqueId, e
                  .getLocalizedMessage());
          invalidOb.setRecordNumber(source.getRow());
          invalidObservations.add(invalidOb);
          continue;
        }

        // TODO: When we do more field validation here,
        // we should do these checks in getNextObservation()
        // and just throw an exception; something like ValidationError?
        // May need to modify some validators to take types other than
        // string. Actually, another approach is to read all fields as
        // strings and then do *exactly* the same validation as for file
        // sourced data.

        if (validOb.getMagnitude().isBrighterThan()) {
          InvalidObservation invalidOb = new InvalidObservation("JD "
              + validOb.getJD(),
              "A \"Brighter Than\" observation.");
          invalidObservations.add(invalidOb);
        } else if (validOb.getHqUncertainty() != null
            && !uncertaintyRangePredicate.holds(validOb
                .getHqUncertainty())) {
          InvalidObservation invalidOb = new InvalidObservation("JD "
              + validOb.getJD(),
              "HQ uncertainty value out of range "
                  + uncertaintyRangePredicate.toString());
          invalidObservations.add(invalidOb);
        } else {
View Full Code Here

                collectObservation(ob);
              }
            } catch (Exception e) {
              String input = tableHDU.getRow(row).toString();
              String error = e.getLocalizedMessage();
              InvalidObservation ob = new InvalidObservation(
                  input, error);
              ob.setRecordNumber(row);
              addInvalidObservation(ob);
            }
          }
        }
      }
View Full Code Here

                obs.add(ob);
              }
            } catch (Exception e) {
              String input = tableHDU.getRow(row).toString();
              String error = e.getLocalizedMessage();
              InvalidObservation ob = new InvalidObservation(
                  input, error);
              ob.setRecordNumber(row);
              addInvalidObservation(ob);
            }
          }
        }
      }
View Full Code Here

        } catch (Exception e) {
          // Create an invalid observation.
          // Record the line number rather than observation number for
          // error reporting purposes, but still increment the latter.
          String error = e.getLocalizedMessage();
          InvalidObservation ob = new InvalidObservation(line, error);
          ob.setRecordNumber(lineNum);
          addInvalidObservation(ob);
        }
      } while (line != null);
    }
View Full Code Here

        } catch (Exception e) {
          // Create an invalid observation.
          // Record the line number rather than observation number for
          // error reporting purposes, but still increment the latter.
          String error = e.getLocalizedMessage();
          InvalidObservation ob = new InvalidObservation(line, error);
          ob.setRecordNumber(lineNum++);
          addInvalidObservation(ob);
        }
      } while (line != null);
    }
View Full Code Here

      } catch (Exception e) {
        // Create an invalid observation. Record the line number
        // rather than the observation number for error reporting
        // purposes, but still increment the latter.
        String error = e.getLocalizedMessage();
        InvalidObservation ob = new InvalidObservation(line, error);
        ob.setRecordNumber(lineNum);
        addInvalidObservation(ob);
      }
      return line;
    }
View Full Code Here

        } catch (Exception e) {
          // Create an invalid observation.
          // Record the line number rather than observation number for
          // error reporting purposes, but still increment the latter.
          String error = e.getLocalizedMessage();
          InvalidObservation ob = new InvalidObservation(line, error);
          ob.setRecordNumber(lineNum);
          obNum++;
          addInvalidObservation(ob);
        }
      } while (line != null);
    }
View Full Code Here

      } catch (Exception e) {
        // Create an invalid observation. Record the line number
        // rather than the observation number for error reporting
        // purposes, but still increment the latter.
        String error = e.getLocalizedMessage();
        InvalidObservation ob = new InvalidObservation(line, error);
        ob.setRecordNumber(lineNum);
        addInvalidObservation(ob);
      }
      return line;
    }
View Full Code Here

        } catch (Exception e) {
          // Create an invalid observation.
          // Record the line number rather than observation number for
          // error reporting purposes, but still increment the latter.
          String error = e.getLocalizedMessage();
          InvalidObservation ob = new InvalidObservation(line, error);
          ob.setRecordNumber(lineNum);
          addInvalidObservation(ob);
        }
      } while (line != null);
    }
View Full Code Here

TOP

Related Classes of org.aavso.tools.vstar.data.InvalidObservation

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.