}
@Override
- protected LeafRefPath createInstance(final LeafRefPath parent,
- final QNameWithPredicate qname) {
- return new AbsoluteLeafRefPath(parent, qname);
+ protected LeafRefPath createInstance(final LeafRefPath newParent,
+ final QNameWithPredicate newQname) {
+ return new AbsoluteLeafRefPath(newParent, newQname);
}
}
}
@Override
- protected LeafRefPath createInstance(final LeafRefPath parent,
- final QNameWithPredicate qname) {
- return new RelativeLeafRefPath(parent, qname);
+ protected LeafRefPath createInstance(final LeafRefPath newParent,
+ final QNameWithPredicate newQname) {
+ return new RelativeLeafRefPath(newParent, newQname);
}
}
private final int hash;
/**
- * Cached legacy path, filled-in when {@link #getPath()} or
+ * Cached legacy path, filled-in when {@link #getPathFromRoot()} or
* {@link #getPathTowardsRoot()} is invoked.
*/
private volatile ImmutableList<QNameWithPredicate> legacyPath;
/**
* Create a new instance.
*
- * @param parent
+ * @param newParent
* Parent LeafRefPath
- * @param qname
+ * @param newQname
* next path element
* @return A new LeafRefPath instance
*/
- protected abstract LeafRefPath createInstance(LeafRefPath parent,
- QNameWithPredicate qname);
+ protected abstract LeafRefPath createInstance(LeafRefPath newParent,
+ QNameWithPredicate newQname);
/**
* Create a child path based on concatenation of this path and a relative
return this;
}
- LeafRefPath parent = this;
- for (QNameWithPredicate qname : relative) {
- parent = parent.createInstance(parent, qname);
+ LeafRefPath newParent = this;
+ for (QNameWithPredicate relativeQname : relative) {
+ newParent = newParent.createInstance(newParent, relativeQname);
}
- return parent;
+ return newParent;
}
/**
public LeafRefPath createChild(final LeafRefPath relative) {
checkArgument(!relative.isAbsolute(), "Child creation requires relative path");
- LeafRefPath parent = this;
- for (QNameWithPredicate qname : relative.getPathFromRoot()) {
- parent = parent.createInstance(parent, qname);
+ LeafRefPath newParent = this;
+ for (QNameWithPredicate relativeQname : relative.getPathFromRoot()) {
+ newParent = newParent.createInstance(newParent, relativeQname);
}
- return parent;
+ return newParent;
}
/**
sb.append(isAbsolute() ? "Absolute path:" : "Relative path:");
- for (QNameWithPredicate qname : getPathFromRoot()) {
- sb.append('/').append(qname);
+ for (QNameWithPredicate qnameWithPredicate : getPathFromRoot()) {
+ sb.append('/').append(qnameWithPredicate);
}
return sb.toString();