考虑:
public List<Place> getAllInactivePlaces() {
return this.placeDAO.findAllUnApprovedList();
}
我上面展示的方法是找到所有地方。我需要转换Queue以获得 FIFO。
像这样的事情:
Queue<Place>placeQueue = getAllInactivePlaces();
假设您当前有一个不是队列的列表(例如ArrayList
)。进一步假设您无法选择适合您的用例的数据结构:
Queue<Place> queue = new LinkedList<>(yourList);
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)