protected void addDelegate ( CatalogEntry entry ) { int pos = 0 ; String partial = entry . getEntryArg ( 0 ) ; Enumeration local = localDelegate . elements ( ) ; while ( local . hasMoreElements ( ) ) { CatalogEntry dpe = ( CatalogEntry ) local . nextElement ( ) ; String dp = dpe . getEntryArg ( 0 ) ; if ( dp . equals ( partial ) ) { // we already have this prefix return ; } if ( dp . length ( ) > partial . length ( ) ) { pos ++ ; } if ( dp . length ( ) < partial . length ( ) ) { break ; } } // now insert partial into the vector at [pos] if ( localDelegate . size ( ) == 0 ) { localDelegate . addElement ( entry ) ; } else { localDelegate . insertElementAt ( entry , pos ) ; } }
Add to the current list of delegated catalogs .