ResourceIndexEntry findClosestMatch(ServiceType resourceType,String resourceName){
  ResourceIndexEntry resourceIndexEntry=null;
  ResourceMatch rm=resourceType.compare(resourceName,this.resourceName,false);
  if (rm.equals(ResourceMatch.EXACT_MATCH) || rm.equals(ResourceMatch.SUB_RESOURCE_MATCH)) {
    resourceIndexEntry=this;
  }
 else   if (rm.equals(ResourceMatch.SUPER_RESOURCE_MATCH)) {
    Iterator iter=childEntries.iterator();
    boolean processed=false;
    while ((!processed) && (iter.hasNext())) {
      ResourceIndexEntry rie=(ResourceIndexEntry)iter.next();
      resourceIndexEntry=rie.findClosestMatch(resourceType,resourceName);
      if (resourceIndexEntry != null) {
        processed=true;
      }
    }
    if (resourceIndexEntry == null) {
      resourceIndexEntry=this;
    }
  }
  return resourceIndexEntry;
}

ResourceIndexEntry findClosestMatch ( ServiceType resourceType , String resourceName ) { ResourceIndexEntry resourceIndexEntry = null ; ResourceMatch rm = resourceType . compare ( resourceName , this . resourceName , false ) ; if ( rm . equals ( ResourceMatch . EXACT_MATCH ) || rm . equals ( ResourceMatch . SUB_RESOURCE_MATCH ) ) { resourceIndexEntry = this ; } else if ( rm . equals ( ResourceMatch . SUPER_RESOURCE_MATCH ) ) { Iterator iter = childEntries . iterator ( ) ; boolean processed = false ; while ( ( ! processed ) && ( iter . hasNext ( ) ) ) { ResourceIndexEntry rie = ( ResourceIndexEntry ) iter . next ( ) ; resourceIndexEntry = rie . findClosestMatch ( resourceType , resourceName ) ; if ( resourceIndexEntry != null ) { processed = true ; } } if ( resourceIndexEntry == null ) { resourceIndexEntry = this ; } } return resourceIndexEntry ; }
finds the index entry with closest matching resource name for a given resource name
