当前位置: 首页>>代码示例>>Java>>正文


Java ObjectSet.isEmpty方法代码示例

本文整理汇总了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;
    }
}
 
开发者ID:GameShopAdvance,项目名称:GameShop-Advance,代码行数:24,代码来源:DbDescrizioneProdottoSingleton.java

示例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);
}
 
开发者ID:GameShopAdvance,项目名称:GameShop-Advance,代码行数:24,代码来源:DbPrenotazioneSingleton.java

示例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;
}
 
开发者ID:GameShopAdvance,项目名称:GameShop-Advance,代码行数:16,代码来源:DbConfigurationSingleton.java

示例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;
}
 
开发者ID:GameShopAdvance,项目名称:GameShop-Advance,代码行数:15,代码来源:DbConfigurationSingleton.java

示例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;
}
 
开发者ID:GameShopAdvance,项目名称:GameShop-Advance,代码行数:15,代码来源:DbConfigurationSingleton.java

示例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);
}
 
开发者ID:GameShopAdvance,项目名称:GameShop-Advance,代码行数:13,代码来源:DbCartaClienteSingleton.java

示例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;
    }
}
 
开发者ID:GameShopAdvance,项目名称:GameShop-Advance,代码行数:39,代码来源:DbPrenotazioneSingleton.java


注:本文中的com.db4o.ObjectSet.isEmpty方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。