*
* @param depth
* the depth into which to descend (0 = only this object, not its
- * children)
+ * children, negative value for infinite depth)
*
* @return the debug {@link String}
*/
*
* <p>
* Not that this state is <b>lossy</b>. You cannot retrieve the data from
- * the state, it can only be used as an ID to check if thw data are
+ * the state, it can only be used as an ID to check if the data are
* identical.
* </p>
*
* Get the recursive state of the current object, i.e., its children
* included. It represents the full state information about this object's
* children.
- *
+ * <p>
* It is not hashed.
*
* @param builder
*
* @param depth
* the depth into which to descend (0 = only this object, not its
- * children)
+ * children, negative value for infinite depth)
*
* @param tab
* the current tabulation increment
builder.append(" ");
builder.append(getContentState(false) + " " + getId());
- if (depth > 0)
+ if (depth != 0)
builder.append(": [");
- if (depth > 0) {
+ if (depth != 0) {
for (E child : this) {
builder.append("\n");
child.getDebugInfo(builder, depth - 1, tab + 1);
}
}
- if (depth > 0) {
+ if (depth != 0) {
builder.append("\n");
for (int i = 0; i < tab; i++)
builder.append(" ");
}
/**
- * Notify that this element has unsaved changes.
+ * Notify that this element <i>and all its parent elements</i> has unsaved
+ * changes.
*/
void setDirty() {
dirty = true;
}
/**
- * Set the parent of this element <i>and all its descendants</i>.
+ * Set the parent of this element.
+ * <p>
+ * Will also check and fix if needed the parent (this) of all its
+ * descendants (recursively).
*
* @param parent
* the new parent