use of gov.sandia.n2a.backend.internal.Wrapper in project n2a by frothga.
the class Instance method path.
/**
* Return a unique name for this instance within the simulation.
* Name consists of the equation set name combined with the index of this part,
* prefixed by the path to the parent part. In the case of a connection, the name
* consists of the path to each of the connected parts.
*/
public String path() {
// In general, container is never null, as that would only happen if this is the instance of Wrapper.
boolean top = container instanceof Wrapper || container == null;
String result;
if (top)
result = "";
else
result = equations.name;
InternalBackendData bed = (InternalBackendData) equations.backendData;
if (bed.index != null && !(this instanceof Population))
result += get(bed.index);
if (top)
return result;
String prefix = container.path();
if (prefix.isEmpty())
return result;
return prefix + "." + result;
}
Aggregations