private void assign(HashMap<String, DBIDs> labelMap, String label, DBIDRef id) {
    if(labelMap.containsKey(label)) {
      DBIDs exist = labelMap.get(label);
      if(exist instanceof DBID) {
        ModifiableDBIDs n = DBIDUtil.newHashSet();
        n.add((DBID) exist);
        n.add(id);
        labelMap.put(label, n);
      }
      else {
        assert (exist instanceof HashSetModifiableDBIDs);
        assert (exist.size() > 1);
        ((ModifiableDBIDs) exist).add(id);
      }
    }
    else {
      labelMap.put(label, DBIDUtil.deref(id));
    }
  }
private void assign ( HashMap < String , DBIDs > labelMap , String label , DBIDRef id ) { if ( labelMap . containsKey ( label ) ) { DBIDs exist = labelMap . get ( label ) ; if ( exist instanceof DBID ) { ModifiableDBIDs n = DBIDUtil . newHashSet ( ) ; n . add ( ( DBID ) exist ) ; n . add ( id ) ; labelMap . put ( label , n ) ; } else { assert ( exist instanceof HashSetModifiableDBIDs ) ; assert ( exist . size ( ) > 1 ) ; ( ( ModifiableDBIDs ) exist ) . add ( id ) ; } } else { labelMap . put ( label , DBIDUtil . deref ( id ) ) ; } }
Assigns the specified id to the labelMap according to its label

@param labelMap the mapping of label to ids
@param label the label of the object to be assigned
@param id the id of the object to be assigned