public List<NamedBean> discoverPairDest(NamedBean source,LayoutEditor editor,Class<?> T,int pathMethod) throws JmriException {
  if (log.isDebugEnabled()) {
    log.debug("discover pairs from source " + source.getDisplayName());
  }
  LayoutBlockManager lbm=InstanceManager.getDefault(LayoutBlockManager.class);
  LayoutBlock lFacing=lbm.getFacingBlockByNamedBean(source,editor);
  List<LayoutBlock> lProtecting=lbm.getProtectingBlocksByNamedBean(source,editor);
  ArrayList<NamedBean> ret=new ArrayList<NamedBean>();
  ArrayList<FacingProtecting> beanList=generateBlocksWithBeans(editor,T);
  try {
    for (    LayoutBlock lb : lProtecting) {
      ret.addAll(discoverPairDest(source,lb,lFacing,beanList,pathMethod));
    }
  }
 catch (  JmriException e) {
    throw e;
  }
  return ret;
}

public List < NamedBean > discoverPairDest ( NamedBean source , LayoutEditor editor , Class < ? > T , int pathMethod ) throws JmriException { if ( log . isDebugEnabled ( ) ) { log . debug ( "discover pairs from source " + source . getDisplayName ( ) ) ; } LayoutBlockManager lbm = InstanceManager . getDefault ( LayoutBlockManager . class ) ; LayoutBlock lFacing = lbm . getFacingBlockByNamedBean ( source , editor ) ; List < LayoutBlock > lProtecting = lbm . getProtectingBlocksByNamedBean ( source , editor ) ; ArrayList < NamedBean > ret = new ArrayList < NamedBean > ( ) ; ArrayList < FacingProtecting > beanList = generateBlocksWithBeans ( editor , T ) ; try { for ( LayoutBlock lb : lProtecting ) { ret . addAll ( discoverPairDest ( source , lb , lFacing , beanList , pathMethod ) ) ; } } catch ( JmriException e ) { throw e ; } return ret ; }
returns a list of valid destination beans reachable from a given source bean .
