本文整理汇总了Java中com.googlecode.cqengine.resultset.ResultSet.isEmpty方法的典型用法代码示例。如果您正苦于以下问题:Java ResultSet.isEmpty方法的具体用法?Java ResultSet.isEmpty怎么用?Java ResultSet.isEmpty使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.googlecode.cqengine.resultset.ResultSet
的用法示例。
在下文中一共展示了ResultSet.isEmpty方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: asCollection
import com.googlecode.cqengine.resultset.ResultSet; //导入方法依赖的package包/类
/**
* Returns a Collection-like view of the given ResultSet.
* <p/>
* The collection simply delegates to the ResultSet, which in turn will reflect
* any changes made to the underlying IndexedCollection by other threads.
* For example consecutive calls to the size() method
* may return different values if objects are added to or removed from the IndexedCollection.
*
* @param resultSet The ResultSet to wrap
* @return A Collection-like view of the given ResultSet
*/
public static <O> Collection<O> asCollection(final ResultSet<O> resultSet) {
return new AbstractCollection<O>() {
@Override
public Iterator<O> iterator() {
return resultSet.iterator();
}
@Override
public int size() {
return resultSet.size();
}
@Override
public boolean contains(Object o) {
@SuppressWarnings("unchecked")
O object = (O)o;
return resultSet.contains(object);
}
@Override
public boolean isEmpty() {
return resultSet.isEmpty();
}
};
}