本文整理汇总了Java中com.db4o.ObjectSet.isEmpty方法的典型用法代码示例。如果您正苦于以下问题:Java ObjectSet.isEmpty方法的具体用法?Java ObjectSet.isEmpty怎么用?Java ObjectSet.isEmpty使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.db4o.ObjectSet
的用法示例。
在下文中一共展示了ObjectSet.isEmpty方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: readBelowThreshold
import com.db4o.ObjectSet; //导入方法依赖的package包/类
/**
* Restituisce gli oggetti DescrizioneProdotto che si trovano al di sotto della soglia stabilita
* @return Lista delle descrizioni sotto soglia
*/
public LinkedList<IDescrizioneProdotto> readBelowThreshold(){
ObjectContainer client = DbManagerSingleton.getInstance().getClient();
ObjectSet<IDescrizioneProdotto> result = client.query(new Predicate<IDescrizioneProdotto>() {
@Override
public boolean match(IDescrizioneProdotto candidate) {
if(candidate.getClass() != DescrizioneProdottoSmartProxy.class)
return false;
else
return candidate.sottoSoglia();
}
});
if(result.isEmpty())
return new ActivatableLinkedList<>();
else{
LinkedList<IDescrizioneProdotto> list = new ActivatableLinkedList<>(result);
return list;
}
}
示例2: read
import com.db4o.ObjectSet; //导入方法依赖的package包/类
public IPrenotazione read(final Integer id)
{
ObjectContainer client = DbManagerSingleton.getInstance().getClient();
ObjectSet<PrenotazioneSmartProxy> result = client.query(new Predicate<PrenotazioneSmartProxy>() {
@Override
public boolean match(PrenotazioneSmartProxy candidate) {
Integer idTrans;
try {
idTrans = candidate.getId();
}
catch (RemoteException ex) {
return false;
}
if(idTrans.intValue() == id.intValue())
return true;
else
return false;
}
});
if(result.isEmpty())
return null;
return (IPrenotazione) result.get(0);
}
示例3: read
import com.db4o.ObjectSet; //导入方法依赖的package包/类
/**
* Recupera dal db l'oggetto Configuration.
* @return la configurazione salvata
*/
public Configuration read(){
Query query = this.db.query();
query.constrain(Configuration.class);
ObjectSet<Object> config = query.execute();
Configuration result;
if(config.isEmpty())
result = null;
else
result = (Configuration) config.get(0);
return result;
}
示例4: read
import com.db4o.ObjectSet; //导入方法依赖的package包/类
/**
* @return la configurazione salvata
*/
public Configuration read(){
Query query = this.db.query();
query.constrain(Configuration.class);
ObjectSet<Object> config = query.execute();
Configuration result;
if(config.isEmpty())
result = null;
else
result = (Configuration) config.get(0);
return result;
}
示例5: read
import com.db4o.ObjectSet; //导入方法依赖的package包/类
/**
* @return configuration dal db
*/
public Configuration read(){
Query query = this.db.query();
query.constrain(Configuration.class);
ObjectSet<Object> config = query.execute();
Configuration result;
if(config.isEmpty())
result = null;
else
result = (Configuration) config.get(0);
return result;
}
示例6: read
import com.db4o.ObjectSet; //导入方法依赖的package包/类
public CartaCliente read(int id)
{
ObjectContainer client = DbManagerSingleton.getInstance().getClient();
Query query=client.query();
query.constrain(CartaCliente.class);
query.descend("codice").constrain(id);
ObjectSet<CartaCliente> cliente = query.execute();
if(cliente.isEmpty())
return null;
return cliente.get(0);
}
示例7: readNotProcessed
import com.db4o.ObjectSet; //导入方法依赖的package包/类
/**
* Restituisce gli oggetti Prenotazione che non sono stati evasi
*
* @return Lista delle prenotazioni non evase
*/
public LinkedList<IPrenotazione> readNotProcessed()
{
ObjectContainer client = DbManagerSingleton.getInstance().getClient();
ObjectSet<IPrenotazione> result = client.query(
new Predicate<IPrenotazione>()
{
@Override
public boolean match(IPrenotazione candidate) {
if(candidate.getClass() != PrenotazioneSmartProxy.class)
return false;
else
return !candidate.getEvasa() && candidate.isCompleted();
}
},
new QueryComparator()
{
public int compare(Object o1, Object o2)
{
IPrenotazione p1 = (IPrenotazione)o1;
DateTime date1 = p1.getDate();
IPrenotazione p2 = (IPrenotazione)o2;
DateTime date2 = p2.getDate();
return (date2.compareTo(date1));
}
}
);
if(result.isEmpty())
return new ActivatableLinkedList<>();
else{
LinkedList<IPrenotazione> list = new ActivatableLinkedList<>(result);
return list;
}
}