Ejemplo n.º 1
0
  /**
   * Determines if the children List contains data of the desired type
   *
   * @param c the desired type
   * @return true if the data is of the desired type
   */
  public boolean containsChild(final Class<? extends HL7Data> c) {
    for (final HL7DataTree child : Util.unNull(this.children)) {
      if (child.getValue().getClass().equals(c)) {
        return true;
      }
    }

    return false;
  }
Ejemplo n.º 2
0
  public HL7DataTree copy() {
    final HL7DataTree copy = new HL7DataTree(this.value);

    for (final HL7DataTree child : Util.unNull(getChildNodes())) {
      copy.addChild(child.copy());
    }

    return copy;
  }
Ejemplo n.º 3
0
  private void fillFlat(final HL7DataTree flat) {
    HL7Data childValue;

    for (final HL7DataTree childNode : Util.unNull(this.children)) {
      childValue = childNode.getValue();
      if (childValue instanceof HL7Segment) {
        flat.addChild(childValue);
      }
      childNode.fillFlat(flat);
    }
  }