jtl-eclipse-master/ASP.resource.asp/src-gen/ASP/resource/asp/grammar/AspContainment.java
/**
 * <copyright>
 * </copyright>
 *
 * 
 */
package ASP.resource.asp.grammar;

public class AspContainment extends ASP.resource.asp.grammar.AspTerminal {
	
	private final org.eclipse.emf.ecore.EClass[] allowedTypes;
	
	public AspContainment(org.eclipse.emf.ecore.EStructuralFeature feature, ASP.resource.asp.grammar.AspCardinality cardinality, org.eclipse.emf.ecore.EClass[] allowedTypes, int mandatoryOccurencesAfter) {
		super(feature, cardinality, mandatoryOccurencesAfter);
		this.allowedTypes = allowedTypes;
	}
	
	public org.eclipse.emf.ecore.EClass[] getAllowedTypes() {
		return allowedTypes;
	}
	
	public String toString() {
		String typeRestrictions = null;
		if (allowedTypes != null && allowedTypes.length > 0) {
			typeRestrictions = ASP.resource.asp.util.AspStringUtil.explode(allowedTypes, ", ", new ASP.resource.asp.IAspFunction1<String, org.eclipse.emf.ecore.EClass>() {
				public String execute(org.eclipse.emf.ecore.EClass eClass) {
					return eClass.getName();
				}
			});
		}
		return getFeature().getName() + (typeRestrictions == null ? "" : "[" + typeRestrictions + "]");
	}
	
}
