package OT; import java.util.*; /** * Abstract alignment constraint. * @version 1999-03-31 * @author Andrea Heiberg, University of Arizona */ abstract public class Align extends Constraint { public Align(FeatureType featureType, Edge edge) { super(featureType, null, edge, true); } //end constructor /** Culls *all* operations for featureType (we have applied all operations on featureType to completion, since Align is a "global" constraint. **/ public Gen cullGen(Gen gen) { Gen newGen = new Gen(gen.input, gen.languageFeatureTypeSet, gen.debug); StringBuffer sb = new StringBuffer(); for (Enumeration e = gen.elements(); e.hasMoreElements();) { Operation op = (Operation)e.nextElement(); if (!(op.featureType.toString().equals(featureType1.toString()))) { newGen.addElement(op); } else { sb.append(this.toString() + ": culled " + op + "\n"); } //end if } //end for gen.debug.write(sb.toString()); sb = null; newGen.trimToSize(); return newGen; } //end cullGen }