@Override protected void step(){
  if (tmpl.serviceTypes.length > 1) {
    while (services.hasNext()) {
      reg=(SvcReg)services.next();
      if (reg.leaseExpiration > now && matchType(tmpl.serviceTypes,reg.item.serviceType) && matchAttributes(tmpl,reg.item))       return;
    }
  }
 else {
    while (services.hasNext()) {
      reg=(SvcReg)services.next();
      if (reg.leaseExpiration > now && matchAttributes(tmpl,reg.item))       return;
    }
  }
  reg=null;
}

@ Override protected void step ( ) { if ( tmpl . serviceTypes . length > 1 ) { while ( services . hasNext ( ) ) { reg = ( SvcReg ) services . next ( ) ; if ( reg . leaseExpiration > now && matchType ( tmpl . serviceTypes , reg . item . serviceType ) && matchAttributes ( tmpl , reg . item ) ) return ; } } else { while ( services . hasNext ( ) ) { reg = ( SvcReg ) services . next ( ) ; if ( reg . leaseExpiration > now && matchAttributes ( tmpl , reg . item ) ) return ; } } reg = null ; }
set reg to the next matching element , or null if none .
