Revision 43628

View differences:

trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.api/src/test/java/org/gvsig/fmap/dal/feature/DummyFetureStore.java
651 651
    public List<Feature> getFeatures(FeatureQuery query) {
652 652
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
653 653
    }
654

  
655
    @Override
656
    public List<Feature> getFeatures(String filter) {
657
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
658
    }
659

  
660
    @Override
661
    public List<Feature> getFeatures(String filter, String sortBy) {
662
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
663
    }
664

  
665
    @Override
666
    public List<Feature> getFeatures(String filter, String sortBy, boolean asc) {
667
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
668
    }
669

  
670
    @Override
671
    public Feature findFirst(String filter) throws DataException {
672
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
673
    }
674

  
675
    @Override
676
    public Feature findFirst(String filter, String sortBy) throws DataException {
677
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
678
    }
679

  
680
    @Override
681
    public Feature findFirst(String filter, String sortBy, boolean asc) throws DataException {
682
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
683
    }
654 684
}
trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.api/src/main/java/org/gvsig/fmap/dal/feature/FeatureStore.java
279 279

  
280 280
    public List<Feature> getFeatures();
281 281

  
282
    public List<Feature> getFeatures(String filter);
283

  
284
    public List<Feature> getFeatures(String filter, String sortBy);
285

  
286
    public List<Feature> getFeatures(String filter, String sortBy, boolean asc);
287

  
288
    public Feature findFirst(String filter) throws DataException;
289

  
290
    public Feature findFirst(String filter, String sortBy) throws DataException;
291

  
292
    public Feature findFirst(String filter, String sortBy, boolean asc) throws DataException;
293

  
282 294
    /**
283 295
     * Returns the feature given its reference.
284 296
     *
trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.impl/src/main/java/org/gvsig/fmap/dal/feature/impl/DefaultFeatureStore.java
1697 1697
        }
1698 1698
        return this.getFeatureSet(query);
1699 1699
    }
1700
    
1701
    @Override
1702
    public List<Feature> getFeatures(String filter)  {
1703
        return this.getFeatures(filter, null, true);
1704
    }
1700 1705

  
1701 1706
    @Override
1707
    public List<Feature> getFeatures(String filter, String sortBy)  {
1708
        return this.getFeatures(filter, sortBy, true);
1709
    }
1710

  
1711
    @Override
1712
    public List<Feature> getFeatures(String filter, String sortBy, boolean asc)  {
1713
        FeatureQuery query = this.createFeatureQuery();
1714
        if( !StringUtils.isEmpty(filter) ) {
1715
            query.setFilter(filter);
1716
        }
1717
        if( !StringUtils.isEmpty(sortBy) ) {
1718
            query.getOrder().add(sortBy, asc);
1719
        }
1720
        return this.getFeatures(query, 100);
1721
    }
1722
    
1723
    @Override
1702 1724
    public List<Feature> getFeatures(FeatureQuery query)  {
1703 1725
        return this.getFeatures(query, 100);
1704 1726
    }
......
1719 1741
    }
1720 1742

  
1721 1743
    @Override
1744
    public Feature findFirst(String filter) throws DataException {
1745
        return this.findFirst(filter, null, true);
1746
    }
1747

  
1748
    @Override
1749
    public Feature findFirst(String filter, String sortBy) throws DataException {
1750
        return this.findFirst(filter, sortBy, true);
1751
    }
1752

  
1753
    @Override
1754
    public Feature findFirst(String filter, String sortBy, boolean asc) throws DataException {
1755
        FeatureSet set = this.getFeatureSet(filter, sortBy, asc);
1756
        if( set==null || set.isEmpty() ) {
1757
            return null;
1758
        }
1759
        DisposableIterator it = set.iterator();
1760
        Feature f = (Feature) it.next();
1761
        it.dispose();
1762
        return f;
1763
    }
1764
    
1765
    @Override
1722 1766
    public void accept(Visitor visitor) throws BaseException {
1723 1767
        FeatureSet set = getFeatureSet();
1724 1768
        try {

Also available in: Unified diff