package models.dataConstraintModel; import models.algebra.Type; public class ResourceHierarchy { private ResourcePath parent; private String resourceName; private Type resourceStateType; private int numParameters; public ResourceHierarchy(ResourcePath parent, String resourceName, Type resourceStateType, int numParameters) { this.parent = parent; this.resourceName = resourceName; this.resourceStateType = resourceStateType; this.numParameters = numParameters; } public ResourcePath getParent() { return parent; } public void setParent(ResourcePath parent) { this.parent = parent; } public String getResourceName() { if (resourceName == null) return parent.getResourceName(); return resourceName; } public void setResourceName(String resourceName) { this.resourceName = resourceName; } public Type getResourceStateType() { return resourceStateType; } public void setResourceStateType(Type resourceStateType) { this.resourceStateType = resourceStateType; } public int getNumParameters() { if (parent == null) return numParameters; return numParameters + parent.getNumberOfParameters(); } public void setNumParameters(int numParameters) { this.numParameters = numParameters; } }