本文整理了Java中org.apache.commons.collections.Buffer.isEmpty()
方法的一些代码示例,展示了Buffer.isEmpty()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Buffer.isEmpty()
方法的具体详情如下:
包路径:org.apache.commons.collections.Buffer
类名称:Buffer
方法名:isEmpty
暂无
代码示例来源:origin: commons-collections/commons-collections
public void testBufferEmpty() {
resetEmpty();
Buffer buffer = (Buffer) collection;
assertEquals(0, buffer.size());
assertEquals(true, buffer.isEmpty());
try {
buffer.get();
fail();
} catch (BufferUnderflowException ex) {}
try {
buffer.remove();
fail();
} catch (BufferUnderflowException ex) {}
}
代码示例来源:origin: org.xwiki.platform/xwiki-platform-search-lucene-api
/**
* Check if the queue is empty or not.
*
* @return <code>true</code> if the queue is empty, <code>false</code> otherwise.
*/
public synchronized boolean isEmpty()
{
return this.namesQueue.isEmpty();
}
代码示例来源:origin: org.objectstyle.ashwood/ashwood
public boolean hasNext() {
return !queue.isEmpty();
}
代码示例来源:origin: org.objectstyle.ashwood/ashwood
public boolean hasNext() {
return !queue.isEmpty();
}
代码示例来源:origin: org.opencms/opencms-solr
/**
* Returns the next publish job from the publish job queue.<p>
*
* @return the next publish job
*/
public CmsPublishJobInfoBean getFirstCachedPublishJob() {
if (!m_publishQueue.isEmpty()) {
return (CmsPublishJobInfoBean)m_publishQueue.get();
} else {
return null;
}
}
代码示例来源:origin: com.atlassian.core/atlassian-core
public synchronized T remove() {
if (!buffer.isEmpty())
return (T) buffer.remove();
else
return null;
}
代码示例来源:origin: org.opencms/opencms-core
/**
* Returns the next publish job from the publish job queue.<p>
*
* @return the next publish job
*/
public CmsPublishJobInfoBean getFirstCachedPublishJob() {
synchronized (m_publishQueue) {
if (!m_publishQueue.isEmpty()) {
return (CmsPublishJobInfoBean)m_publishQueue.get();
} else {
return null;
}
}
}
代码示例来源:origin: org.objectstyle.ashwood/ashwood
public void reset(Object newFirstVertex) {
if (!queue.isEmpty()) queue.clear();
if (!seen.isEmpty()) seen.clear();
this.firstVertex = newFirstVertex;
queue.add(firstVertex);
seen.add(firstVertex);
}
代码示例来源:origin: org.objectstyle.ashwood/ashwood
public void reset(Collection newFirstVertices, Attribute level) {
if (!queue.isEmpty()) queue.clear();
if (!seen.isEmpty()) seen.clear();
this.firstVertices = newFirstVertices;
this.level = level;
queue.addAll(firstVertices);
seen.addAll(firstVertices);
for (Iterator i = firstVertices.iterator(); i.hasNext(); ) {
level.set(i.next(), new Integer(0));
}
validTree = true;
}
代码示例来源:origin: bioinformatics-ua/dicoogle
@Override
public boolean hasNext() {
if(!(isCancelled() || isDone()))
return true;
return !resultBuffer.isEmpty();
}
代码示例来源:origin: ch.epfl.gsn/gsn-core
public void run ( ) {
timer.start( );
if(delayPostingElements){
logger.debug("Starting <" + getWrapperName() + "> with delayed elements.");
while(isActive()){
synchronized(objectLock){
while(streamElementBuffer.isEmpty()){
try {
objectLock.wait();
} catch (InterruptedException e) {
logger.error( e.getMessage( ) , e );
}
}
}
try{
int nextInt = RandomUtils.nextInt(maximumDelay);
Thread.sleep(nextInt);
// System.out.println("next delay : " + nextInt + " --> buffer size : " + streamElementBuffer.size());
}catch(InterruptedException e){
logger.error( e.getMessage( ) , e );
}
if(!streamElementBuffer.isEmpty()){
StreamElement nextStreamElement = (StreamElement)streamElementBuffer.remove();
postStreamElement(nextStreamElement);
}
}
}
}
代码示例来源:origin: org.objectstyle.ashwood/ashwood
public void breadthFirstSort() {
Buffer queue = new UnboundedFifoBuffer();
Set seen = new HashSet();
queue.addAll(layers[0]);
seen.addAll(layers[0]);
int[] indices = new int[layers.length];
while (!queue.isEmpty()) {
LayerVertex origin = (LayerVertex)queue.remove();
origin.setIndexInLayer(indices[origin.getRank()]++);
for (int i = 0; i < origin.outDegree(); i++) {
Object dst = origin.getSuccessors().get(i);
if (seen.add(dst)) queue.add(dst);
}
}
for (int i = 0; i < layers.length; i++) {
layers[i].sort();
}
}
代码示例来源:origin: org.opencms/opencms-core
if (!messageQueue.isEmpty()) {
while (!messageQueue.isEmpty()) {
CmsBroadcast message = (CmsBroadcast)messageQueue.remove();
result.append('[');
代码示例来源:origin: org.opencms/opencms-solr
if (!messageQueue.isEmpty()) {
while (!messageQueue.isEmpty()) {
CmsBroadcast message = (CmsBroadcast)messageQueue.remove();
result.append('[');
代码示例来源:origin: org.opencms/opencms-core
if (!queue.isEmpty()) {
StringBuffer broadcasts = new StringBuffer();
while (!queue.isEmpty()) {
CmsBroadcast broadcastMessage = (CmsBroadcast)queue.remove();
String from = broadcastMessage.getUser() != null
代码示例来源:origin: org.opencms/org.opencms.workplace.tools.workplace
/**
* @see org.opencms.workplace.tools.A_CmsHtmlIconButton#isVisible()
*/
@Override
public boolean isVisible() {
if (getItem() != null) {
return !OpenCms.getSessionManager().getBroadcastQueue(getItem().getId()).isEmpty();
}
return super.isVisible();
}
};
代码示例来源:origin: org.opencms/org.opencms.workplace.tools.workplace
/**
* @see org.opencms.workplace.tools.A_CmsHtmlIconButton#isVisible()
*/
@Override
public boolean isVisible() {
if (getItem() != null) {
return OpenCms.getSessionManager().getBroadcastQueue(getItem().getId()).isEmpty();
}
return super.isVisible();
}
};
代码示例来源:origin: org.opencms/opencms-core
if (!messageQueue.isEmpty()) {
CmsMessages messages = org.opencms.workplace.Messages.get().getBundle(
OpenCms.getWorkplaceManager().getWorkplaceLocale(getCmsObject()));
List<CmsBroadcastMessage> result = new ArrayList<CmsBroadcastMessage>();
while (!messageQueue.isEmpty()) {
CmsBroadcast broadcastMessage = (CmsBroadcast)messageQueue.remove();
CmsBroadcastMessage message = new CmsBroadcastMessage(
内容来源于网络,如有侵权,请联系作者删除!