由于selectArgs不正确,我正在执行以下方法但没有成功(至少这是我所相信的.
找到所有:
public Collection<Object> findAllByCodigoSetorOrderByStatusWhereDataAgendamentoIsNull(Integer vendedor) {
Collection<Object> objects = null;
String selection = Object.FIELDS[20] + "=?" + " OR " + Object.FIELDS[20] + "=?" + " OR " + Object.FIELDS[20] + "=?" + " AND " + Object.FIELDS[6] + "=?";
String[] selectionArgs = new String[] { "''", "'null'", "NULL", String.valueOf(vendedor) };
Collection<ContentValues> results = findAllObjects(Object.TABLE_NAME, selection, selectionArgs, Object.FIELDS, null, null, Object.FIELDS[4]);
objects = new ArrayList<Object>();
for (ContentValues result : results) {
objects.add(new Object(result));
}
return objects;
}
Run Code Online (Sandbox Code Playgroud)
findAllObjects:
protected …Run Code Online (Sandbox Code Playgroud) int fn(unsigned int x)
{
int count = 0 ;
for(; x!=0; x&=(x-1))
count ++;
return count;
}
Run Code Online (Sandbox Code Playgroud)
我在编译器中尝试过,但无法弄清楚发生了什么.我认为这与位数有关x,但是什么?