//(c):Ayse Cirakoglu package gzz.potion.potions; import java.util.*; import gzz.vob.linebreaking.HChain; import gzz.*; import gzz.potion.*; public class Headcell implements Function { public String getString(Expression[] params, Map context) { String s = params[0].getString(context); String t = params[1].getString(context); return "The headcell of "+s+" in "+t; } public void render(Expression[] params,Map context, HChain into) { } public Type[] getParams() { return null; } public List evaluate(List[] params, Map context) { List result = new ArrayList(); List cells = params[0]; for (Iterator c= cells.iterator(); c.hasNext();) { Cell cell = (Cell)c.next(); List dims = params[1]; for(Iterator d = dims.iterator(); d.hasNext();) { Dim dim = (Dim)d.next(); result.add(cell.h(dim)); } } return result; } }