Пример #1
0
  /**
   * Returns an ArrayList of descriptions (as Strings) for this structure, and if it contains
   * multiples structures, all of those, in order.
   */
  @Override
  public ArrayList<String> extractDescriptions() {
    Structure structureData =
        DisplayDataProcessor.processDisplayStructure(oneToMany.getDisplayData());

    ArrayList<String> ret = new ArrayList<String>();
    ret.addAll(structureData.extractDescriptions());
    return ret;
  }
Пример #2
0
  /**
   * Pass in the raw data from an Assessment object, and this will return it in happy, displayable
   * String form
   *
   * @return ArrayList of Strings, having converted the rawData to nicely displayable String data.
   *     Happy days!
   */
  @Override
  public int getDisplayableData(
      ArrayList<String> rawData, ArrayList<String> prettyData, int offset) {
    int num =
        ((String) rawData.get(offset)).matches("\\d")
            ? Integer.parseInt((String) rawData.get(offset))
            : 0;
    prettyData.add(offset, num + " selected.");

    offset++;

    Structure def = DisplayDataProcessor.processDisplayStructure(oneToMany.getDisplayData());

    for (int i = 0; i < num; i++) offset = def.getDisplayableData(rawData, prettyData, offset);

    return offset;
  }