int nSize = m_updateMappingSet.size();
List updateList = new ArrayList(nSize);
BitSet updateSet = (BitSet)updateAttributeSet.clone();
// Compute cover
Holder potentialMappingSet = new HashHolder(nSize);
for (int i = 0; i < nSize; i++)
{
potentialMappingSet.add(m_updateMappingSet.get(i));
}
boolean bSelectUnbatchable = false;
while (!(potentialMappingSet.isEmpty() || updateSet.isEmpty()))
{
int nBestScore = 0;
UpdateMappingCase bestMapping = null;
for (Iterator itr = potentialMappingSet.iterator(); itr.hasNext(); )
{
UpdateMappingCase candidateMapping = (UpdateMappingCase)itr.next();
if (candidateMapping.isBatch() ^ bSelectUnbatchable)
{
BitSet candidateSet = (BitSet)candidateMapping.getAttributeSet().clone();
candidateSet.and(updateSet);
int nScore = candidateSet.cardinality();
if (nScore > nBestScore)
{
nBestScore = nScore;
bestMapping = candidateMapping;
}
}
}
if (bestMapping != null)
{
potentialMappingSet.remove(bestMapping);
updateList.add(bestMapping);
updateSet.andNot(bestMapping.getAttributeSet());
}
else
{