private void deleteAttrs(SvcReg reg,EntryRep entry,boolean checkDups){
  EntryClass eclass=entry.eclass;
  deleteInstance(eclass);
  Object[] fields=entry.fields;
  if (fields.length == 0) {
    ArrayList regs=serviceByEmptyAttr.get(eclass);
    if (regs == null || (checkDups && hasEmptyAttr(reg,eclass)))     return;
    int idx=regs.indexOf(reg);
    if (idx >= 0) {
      regs.remove(idx);
      if (regs.isEmpty())       serviceByEmptyAttr.remove(eclass);
    }
    return;
  }
  for (int fldidx=fields.length; --fldidx >= 0; ) {
    eclass=getDefiningClass(eclass,fldidx);
    HashMap[] attrMaps=serviceByAttr.get(eclass);
    if (attrMaps == null || attrMaps[fldidx] == null || (checkDups && hasAttr(reg,eclass,fldidx,fields[fldidx])))     continue;
    HashMap map=attrMaps[fldidx];
    Object value=fields[fldidx];
    ArrayList regs=(ArrayList)map.get(value);
    if (regs == null)     continue;
    int idx=regs.indexOf(reg);
    if (idx < 0)     continue;
    regs.remove(idx);
    if (!regs.isEmpty())     continue;
    map.remove(value);
    if (!map.isEmpty())     continue;
    attrMaps[fldidx]=null;
    if (allNull(attrMaps))     serviceByAttr.remove(eclass);
  }
}

private void deleteAttrs ( SvcReg reg , EntryRep entry , boolean checkDups ) { EntryClass eclass = entry . eclass ; deleteInstance ( eclass ) ; Object [ ] fields = entry . fields ; if ( fields . length == 0 ) { ArrayList regs = serviceByEmptyAttr . get ( eclass ) ; if ( regs == null || ( checkDups && hasEmptyAttr ( reg , eclass ) ) ) return ; int idx = regs . indexOf ( reg ) ; if ( idx >= 0 ) { regs . remove ( idx ) ; if ( regs . isEmpty ( ) ) serviceByEmptyAttr . remove ( eclass ) ; } return ; } for ( int fldidx = fields . length ; -- fldidx >= 0 ; ) { eclass = getDefiningClass ( eclass , fldidx ) ; HashMap [ ] attrMaps = serviceByAttr . get ( eclass ) ; if ( attrMaps == null || attrMaps [ fldidx ] == null || ( checkDups && hasAttr ( reg , eclass , fldidx , fields [ fldidx ] ) ) ) continue ; HashMap map = attrMaps [ fldidx ] ; Object value = fields [ fldidx ] ; ArrayList regs = ( ArrayList ) map . get ( value ) ; if ( regs == null ) continue ; int idx = regs . indexOf ( reg ) ; if ( idx < 0 ) continue ; regs . remove ( idx ) ; if ( ! regs . isEmpty ( ) ) continue ; map . remove ( value ) ; if ( ! map . isEmpty ( ) ) continue ; attrMaps [ fldidx ] = null ; if ( allNull ( attrMaps ) ) serviceByAttr . remove ( eclass ) ; } }
if checkdups is false , delete the service ( if present ) from servicebyattr under all attribute values of the given entry or from servicebyemptyattr if the entry has no attributes . if checkdups is true , only delete for a given attribute value if the service has no other entries of similar type that still have the same value . either way , delete an instance of the entryclass , and update entryclasses as necessary .
