private fun assign(labelMap: HashMap<String, DBIDs>, label: String, id: DBIDRef) { if (labelMap.containsKey(label)) { val exist: DBIDs? = labelMap[label] if (exist is DBID) { val n: ModifiableDBIDs = DBIDUtil.newHashSet() n.add(exist as DBID?) n.add(id) labelMap[label] = n } else { assert(exist is HashSetModifiableDBIDs) assert(exist.size() > 1) (exist as ModifiableDBIDs?).add(id) } } else { labelMap[label] = DBIDUtil.deref(id) } }
Assigns the specified id to the labelMap according to its label