package edu.vt.marian.search; import java.util.*; import java.io.*; import edu.vt.marian.common.*; /** * A mapping from (weighted) single nodes along links of a particular class in a particular direction to all the connected nodes at the other end. * * @author Robert France * @see WtdObjToSetMapping * @see LinkClassManager */ public class LinkSetMapping implements WtdObjToSetMapping { protected Debug debug; protected LinkClassManager linkMgr; protected int dir; public LinkSetMapping(LinkClassManager linkManager, int direction, Debug d) { debug = d; if (linkManager == null) debug.dumpTrace("LinkSetMap: null parameter."); linkMgr = linkManager; if (! LinkDesc.isValidDirection(direction) ) debug.dumpTrace("LinkSetMap: invalid direction " + direction + "."); dir = direction; } /** * Add a new component set to the Sequencer with no scaling constant. * * @param set a component weighted object set. * @return ReturnValues.OK -- set was added without problems. *
anything else -- problems. */ public WtdObjSet map(WtdObj key) { return( linkMgr.keyNodeToTargetSet(key, dir) ); } }