001package org.clafer.ast; 002 003/** 004 * A primitive Clafer. Primitive Clafers require built in support from the 005 * solver. 006 * 007 * @author jimmy 008 */ 009public abstract class AstPrimClafer extends AstClafer { 010 011 AstPrimClafer(String name) { 012 super(name, null); 013 } 014 015 /** 016 * {@inheritDoc} 017 */ 018 @Override 019 public AstClafer extending(AstAbstractClafer superClafer) { 020 throw new UnsupportedOperationException("Cannot extend from " + getName() + " primitive"); 021 } 022 023 /** 024 * {@inheritDoc} 025 */ 026 @Override 027 public AstClafer refTo(AstClafer targetType) { 028 throw new UnsupportedOperationException("Cannot ref from " + getName() + " primitive"); 029 } 030 031 /** 032 * {@inheritDoc} 033 */ 034 @Override 035 public AstClafer refToUnique(AstClafer targetType) { 036 throw new UnsupportedOperationException("Cannot ref from " + getName() + " primitive"); 037 } 038 039 /** 040 * {@inheritDoc} 041 */ 042 @Override 043 public AstConcreteClafer withGroupCard(Card groupCard) { 044 throw new UnsupportedOperationException("Cannot set group cardinality for " + getName() + " primitive"); 045 } 046 047 /** 048 * {@inheritDoc} 049 */ 050 @Override 051 public AstConcreteClafer addChild(String name) { 052 throw new UnsupportedOperationException("Cannot add a child under " + getName() + " primitive"); 053 } 054 055 /** 056 * {@inheritDoc} 057 */ 058 @Override 059 public AstConstraint addConstraint(AstBoolExpr constraint) { 060 throw new UnsupportedOperationException("Cannot add a constraint under " + getName() + " primitive"); 061 } 062}