tgtools.tasklibrary.entity.DataCenter Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of tgtools.tasklibrary Show documentation
Show all versions of tgtools.tasklibrary Show documentation
base tgtools.tasklibrary task tools
package tgtools.tasklibrary.entity;
import java.util.concurrent.ConcurrentLinkedQueue;
public class DataCenter {
public DataCenter()
{
m_Data = new ConcurrentLinkedQueue();
}
private ConcurrentLinkedQueue m_Data;
private synchronized ConcurrentLinkedQueue getDatas() {
if (null == m_Data) {
m_Data = new ConcurrentLinkedQueue();
}
return m_Data;
}
public int size()
{
return m_Data.size();
}
public SqlEntity get() {
if(!getDatas().isEmpty())
return getDatas().poll();
return null;
}
public void add(SqlEntity p_Sql) {
getDatas().add(p_Sql);
}
public boolean isEmpty(){
return getDatas().isEmpty();
}
}